GHSA-5R27-RW8R-7967
Vulnerability from github – Published: 2023-08-08 19:26 – Updated: 2023-08-14 13:14Impact
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-middleand support for EcmaScript Modules is not needed, ensure that none of the following options are set (either via command-line or theNODE_OPTIONSenvironment 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 security@datadoghq.com
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.4.1"
},
"package": {
"ecosystem": "npm",
"name": "import-in-the-middle"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.4.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-38704"
],
"database_specific": {
"cwe_ids": [
"CWE-20"
],
"github_reviewed": true,
"github_reviewed_at": "2023-08-08T19:26:40Z",
"nvd_published_at": "2023-08-07T20:15:09Z",
"severity": "HIGH"
},
"details": "### Impact\nThe `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.\n\n### Patches\nThis vulnerability has been patched in `import-in-the-middle` version 1.4.2\n\n### Workarounds\n* Do not pass any user-supplied input to `import()`. Instead, verify it against a set of allowed values.\n* 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 the `NODE_OPTIONS` environment variable):\n```\n--loader=import-in-the-middle/hook.mjs\n--loader import-in-the-middle/hook.mjs\n```\n\n### References\nIf you have any questions or comments about this advisory, email us at [security@datadoghq.com](mailto:security@datadoghq.com)",
"id": "GHSA-5r27-rw8r-7967",
"modified": "2023-08-14T13:14:54Z",
"published": "2023-08-08T19:26:40Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/DataDog/import-in-the-middle/security/advisories/GHSA-5r27-rw8r-7967"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-38704"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/import-in-the-middle/commit/2531cdd9d1d73f9eaa87c16967f60cb276c1971b"
},
{
"type": "PACKAGE",
"url": "https://github.com/DataDog/import-in-the-middle"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "import-in-the-middle has unsanitized user controlled input in module generation"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.