Vulnerabilities in pkg:npm/@opentelemetry/instrumentation
PACKAGEGHSA-f8pq-3926-8gx5 is a HIGH (CVSS 8.1) unsanitized user controlled input vulnerability (General Security Weakness) affecting @opentelemetry/instrumentation libraries in the npm ecosystem. The issue involves unsanitized user controlled input in module generation. Remediation is available by upgrading affected packages to version 0.41.2.
pkg:npm/@opentelemetry/instrumentation
Vulnerability advisories affecting package pkg:npm/@opentelemetry/instrumentation. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-f8pq-3926-8gx5 | - | HIGH | Unsanitized user controlled input in module generation |
GHSA-f8pq-3926-8gx5 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L).
How to Fix GHSA-f8pq-3926-8gx5
To remediate this vulnerability, upgrade all affected @opentelemetry/instrumentation dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @opentelemetry/instrumentation@0.41.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @opentelemetry/instrumentation
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-f8pq-3926-8gx5, inspect your project dependencies using npm:
npm ls @opentelemetry/instrumentation
Analyze the terminal output to locate any version of @opentelemetry/instrumentation in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.41.2), your application is affected.
Note: The npm ls @opentelemetry/instrumentation command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In @opentelemetry/instrumentation, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-f8pq-3926-8gx5 Affected @opentelemetry/instrumentation Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@opentelemetry/instrumentation
|
npm |
≥ 0.40.0
< 0.41.2
|
0.41.2
|
References
Frequently Asked Questions
What is GHSA-f8pq-3926-8gx5?
Which @opentelemetry/instrumentation versions are affected?
What version fixes GHSA-f8pq-3926-8gx5?
Is @opentelemetry/instrumentation affected?
What is the CVSS score of GHSA-f8pq-3926-8gx5?
What CWE is associated with GHSA-f8pq-3926-8gx5?
How can I check npm dependencies for GHSA-f8pq-3926-8gx5?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8pq-3926-8gx5",
"modified" : "2023-08-09T20:59:14Z",
"published" : "2023-08-09T20:59:14Z",
"aliases" : [ ],
"summary" : "Unsanitized user controlled input in module generation",
"details" : "## Impact\n\nThe `import-in-the-middle` loader used by `@opentelemetry/instrumentation` 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\n\nThis vulnerability has been patched in `@opentelemetry/instrumentation` version `0.41.2`\n\n## Workarounds\n\n- Do not pass any user-supplied input to `import()`. Instead, verify it against a set of allowed values.\n- If using `@opentelemetry/instrumentation` with 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--experimental-loader=@opentelemetry/instrumentation/hook.mjs\n--experimental-loader @opentelemetry/instrumentation/hook.mjs\n--loader=import-in-the-middle/hook.mjs\n--loader import-in-the-middle/hook.mjs\n```\n\n## References\n\n- https://github.com/DataDog/import-in-the-middle/security/advisories/GHSA-5r27-rw8r-7967",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@opentelemetry/instrumentation"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.40.0"
}, {
"fixed" : "0.41.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/open-telemetry/opentelemetry-js/security/advisories/GHSA-f8pq-3926-8gx5"
}, {
"type" : "WEB",
"url" : "https://github.com/open-telemetry/opentelemetry-js/commit/ffe641c08c69f41ca8d292221dc1804d511efb28"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/open-telemetry/opentelemetry-js"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-09T20:59:14Z",
"nvd_published_at" : null
}
}