Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS01cjI3LXJ3OHItNzk2N84AA1KN
import-in-the-middle has unsanitized user controlled input in module generation
Impact
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. It allows for remote code execution in cases where an application passes user-supplied input directly to an import() function.
Patches
This vulnerability has been patched in import-in-the-middle
version 1.4.2
Workarounds
- Do not pass any user-supplied input to
import()
. Instead, verify it against a set of allowed values. - If using
import-in-the-middle
and support for EcmaScript Modules is not needed, ensure that none of the following options are set (either via command-line or theNODE_OPTIONS
environment variable):
--loader=import-in-the-middle/hook.mjs
--loader import-in-the-middle/hook.mjs
References
If you have any questions or comments about this advisory, email us at [email protected]
Permalink: https://github.com/advisories/GHSA-5r27-rw8r-7967JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01cjI3LXJ3OHItNzk2N84AA1KN
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 9 months ago
Updated: 6 months ago
CVSS Score: 8.1
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L
Identifiers: GHSA-5r27-rw8r-7967, CVE-2023-38704
References:
- https://github.com/DataDog/import-in-the-middle/security/advisories/GHSA-5r27-rw8r-7967
- https://nvd.nist.gov/vuln/detail/CVE-2023-38704
- https://github.com/DataDog/import-in-the-middle/commit/2531cdd9d1d73f9eaa87c16967f60cb276c1971b
- https://github.com/advisories/GHSA-5r27-rw8r-7967
Blast Radius: 26.7
Affected Packages
npm:import-in-the-middle
Dependent packages: 10Dependent repositories: 1,960
Downloads: 24,187,698 last month
Affected Version Ranges: <= 1.4.1
Fixed in: 1.4.2
All affected versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.0, 1.4.1
All unaffected versions: 1.4.2, 1.5.0, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4