CVE-2023-38704

High

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.

SeverityHigh
CVSS8.1
Exploit probability—
ProductDatadoghq Import-in-the-middle
PublishedAug 7, 2023
First seenAug 7, 2023

How to fix

Update
  • datadoghq import-in-the-middle1.4.2 or later
  • import-in-the-middle1.4.2 or later

Affected products

ProductAffected versionsFixed in
datadoghq import-in-the-middlev < 1.4.21.4.2
import-in-the-middlenpmv < 1.4.21.4.2

Check your version

Choose the product and enter the version you run to see whether it falls in the affected range.

In the Intelligence 360 plan

Attack Surface Management

See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.