import-in-the-middle allows unsanitized user controlled input in module generation
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| DataDog | import-in-the-middle | before 1.4.2 | 1.4.2 | Patch available | CNA |
| — | import-in-the-middle (npm) | before 1.4.2 | 1.4.2 | Patch available | GHSA-5r27-rw8r-7967 |
- import-in-the-middle VendorDataDog Affected before 1.4.2 Fixed in 1.4.2 Patch available CNA
- import-in-the-middle (npm) Vendor— Affected before 1.4.2 Fixed in 1.4.2 Patch available GHSA-5r27-rw8r-7967
Remediation
- Fix · CNA import-in-the-middle (DataDog) Fixed in 1.4.2
- Fix · GHSA-5r27-rw8r-7967 import-in-the-middle (npm) Fixed in 1.4.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-38704
- 2026-10-03 Alias added: GHSA-5r27-rw8r-7967
References
Patch 1
Advisory 2
More DataDog vulnerabilities
- TI-2026-32833 GuardDog: Blind GitHub URL rewrite in remote project scanning causes SSRF and `GH_TOKEN` exfiltration CVSS 3.1HIGH 8.2
- TI-2022-07587 GuardDog vulnerable to arbitrary file write when scanning a specially-crafted remote PyPI package CVSS 3.1MEDIUM 6.5
- TI-2026-26107 dd-trace-java: Unsafe deserialization in RMI instrumentation may lead to remote code execution CVSS 4.0CRITICAL 9.3
- TI-2026-81528 ReDoS in dd-trace URL query string obfuscation CVSS 4.0HIGH 8.7
- TI-2026-80927 ReDoS in Datadog dd-trace-py URL query string obfuscation CVSS 4.0HIGH 8.7
- TI-2026-80928 Datadog dd-trace-py IAST flaw lets attackers crash Python processes CVSS 4.0HIGH 8.2
Sources
- CVE-2023-38704 · CVE Program
- CVE-2023-38704 · NVD
- FIRST EPSS
- GHSA-5r27-rw8r-7967 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences