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

--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-7967
JSON: 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: Repository: https://github.com/DataDog/import-in-the-middle
Blast Radius: 26.7

Affected Packages

npm:import-in-the-middle
Dependent packages: 10
Dependent 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