Security mailing lists by PureSourceCode

CVE-2023-38704

CRITICAL 9.8CVSS 3.1

import-in-the-middle has unsanitized user controlled input in module generation

import-in-the-middle is a module loading interceptor specifically for ESM modules. The import-in-the-middle loader works by generating a wrapper module on the fly. The wrapper uses the module specifier to load the original module and add some wrapping code. Prior to version 1.4.2, it allows for remote code execution in cases where an application passes user-supplied input directly to the import() function. This vulnerability has been patched in import-in-the-middle version 1.4.2.

Some workarounds are available. Do not pass any user-supplied input to import(). Instead, verify it against a set of allowed values. If using import-in-the-middle, directly or indirectly, and support for EcmaScript Modules is not needed, ensure that no options are set, either via command-line or the NODE_OPTIONS environment variable, that would enable loader hooks.

Published
7 Aug 2023
Last modified
10 Sep 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-20
Also known as
GHSA-5r27-rw8r-7967
Sources
NVDJSONOSV GHSA-5r27-rw8r-7967JSON

Scores

SourceScored byVersionScoreVector / decision
NVD nvd@nist.gov (Primary) CVSS 3.1 CRITICAL 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L
OSV GitHub CVSS 3.1 HIGH 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD datadoghq import-in-the-middle
cpe:2.3:a:datadoghq:import-in-the-middle:*:*:*:*:*:node.js:*:*
< 1.4.2 1.4.2
OSV npm import-in-the-middle < 1.4.2 1.4.2

References

History

  • 25 Nov 2026 20:36 UTC · NVD: first stored (published 7 Aug 2023)
  • 25 Nov 2026 20:10 UTC · OSV: first stored (published 8 Aug 2023)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.