CVE-2024-10491: Express Remote Code Execution Vulnerability
MODERATECVE-2024-10491 is a MODERATE (CVSS 4.0) remote code execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Express libraries in the npm ecosystem. The issue involves express ressource injection. Remediation is available by upgrading affected packages to version 4.0.0-rc1.
CVE-2024-10491 at a Glance
Security Impact
CVSS: 4.0
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:L/I:N/A:N).
How to Fix CVE-2024-10491
To remediate this vulnerability, upgrade all affected Express 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 express@4.0.0-rc1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls express
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-10491, inspect your project dependencies using npm:
npm ls express
Analyze the terminal output to locate any version of Express in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.0-rc1), your application is affected.
Note: The npm ls express 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 CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Express, 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
CVE-2024-10491 Affected Express Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
express
|
npm |
< 4.0.0-rc1
|
4.0.0-rc1
|
References
Frequently Asked Questions
What is CVE-2024-10491?
Which Express versions are affected?
What version fixes CVE-2024-10491?
Is express affected?
What is the CVSS score of CVE-2024-10491?
What CWE is associated with CVE-2024-10491?
How can I check npm dependencies for CVE-2024-10491?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cm5g-3pgc-8rg4",
"modified" : "2024-12-19T17:52:09Z",
"published" : "2024-10-29T18:30:37Z",
"aliases" : [ "CVE-2024-10491" ],
"summary" : "Express ressource injection",
"details" : "A vulnerability has been identified in the Express response.links function, allowing for arbitrary resource injection in the Link header when unsanitized data is used.\n\nThe issue arises from improper sanitization in `Link` header values, which can allow a combination of characters like `,`, `;`, and `<>` to preload malicious resources.\n\nThis vulnerability is especially relevant for dynamic parameters.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "express"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.0-rc1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.21.4"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-10491"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/express/issues/6222"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/expressjs/express"
}, {
"type" : "WEB",
"url" : "https://www.herodevs.com/vulnerability-directory/cve-2024-10491"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-25T21:31:20Z",
"nvd_published_at" : "2024-10-29T17:15:03Z"
}
}