9.8

CVE-2023-38704: import-in-the-middle allows unsanitized user controlled input in module generation

Modified
AliasesGHSA-5r27-rw8r-7967
Published 07-08-2023Last modified 03-10-2024

Vulnerability summary

CVE-2023-38704 is a critical (CVSS 9.8) Improper Input Validation vulnerability in datadog import-in-the-middle. EPSS estimates a 1.00% chance of exploitation in the next 30 days, higher than 63.9% of scored vulnerabilities.

Priority
Prioritisesevere

Severe, CVSS 8.1 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)

Source freshness unavailable

How is this decided?
CVSS score
9.8/10
010
Critical · v3.1 (NVD)
EPSS score
1.00%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Timeline

  1. 07-08-2023
    PublishedVulnerability first disclosed.
  2. 03-10-2024
    Last modifiedVulnerability information updated.

Description

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.

CVSS metrics

3 scores · 3 sources · 1 version

EPSS trend

Probability

1.00%

Chance of exploitation in the next 30 days

Percentile

64%

Versus all other CVEs

30-day change

No change 0.00 pp

From 1.00% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

Datadog1 product
Datadoghq1 product
Npm1 product
  • import-in-the-middle< 1.4.2

3 vendors · 3 products

References

4 links