Vulnerabilities in pkg:npm/body-parser
PACKAGECVE-2026-12590 is a LOW (CVSS 3.7) remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Body parser libraries in the npm ecosystem. The issue involves body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement. Remediation is available by upgrading affected packages to version 1.20.6, 2.3.0.
pkg:npm/body-parser
Vulnerability advisories affecting package pkg:npm/body-parser. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-v422-hmwv-36x6 | CVE-2026-12590 | LOW | body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement |
| GHSA-wqch-xfxh-vrr4 | CVE-2025-13466 | MODERATE | body-parser is vulnerable to denial of service when url encoding is used |
| GHSA-qwcr-r2fm-qrc7 | CVE-2024-45590 | HIGH | body-parser vulnerable to denial of service when url encoding is enabled |
CVE-2026-12590 at a Glance
Security Impact
CVSS: 3.7
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:U/C:N/I:N/A:L).
How to Fix CVE-2026-12590
To remediate this vulnerability, upgrade all affected Body parser 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 body-parser@1.20.6
npm install body-parser@2.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls body-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-12590, inspect your project dependencies using npm:
npm ls body-parser
Analyze the terminal output to locate any version of Body parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20.6), your application is affected.
Note: The npm ls body-parser 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Body parser, 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-2026-12590 Affected Body parser Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
body-parser
|
npm |
< 1.20.6
|
1.20.6
|
|
body-parser
|
npm |
≥ 2.0.0
< 2.3.0
|
2.3.0
|
References
Frequently Asked Questions
What is CVE-2026-12590?
Which Body parser versions are affected?
What version fixes CVE-2026-12590?
Is body-parser affected?
What is the CVSS score of CVE-2026-12590?
What CWE is associated with CVE-2026-12590?
How can I check npm dependencies for CVE-2026-12590?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v422-hmwv-36x6",
"modified" : "2026-07-20T23:23:26Z",
"published" : "2026-07-20T23:23:26Z",
"aliases" : [ "CVE-2026-12590" ],
"summary" : "body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement",
"details" : "### Impact\n\nWhen body-parser is configured with an invalid `limit` option value, such as an unparseable string or `NaN`, `bytes.parse()` returns `null` and the request body size check is silently skipped. Applications that rely on `limit` as their primary safeguard against oversized request bodies will accept arbitrarily large payloads, leading to excessive memory and CPU usage and denial of service.\n\nThis issue affects applications that pass a programmatically computed or user-configurable value to the `limit` option without validating it first.\n\n### Patches\n\nThis issue is fixed in [body-parser@2.3.0](https://github.com/expressjs/body-parser/releases/tag/v2.3.0) and [body-parser@1.20.6](https://github.com/expressjs/body-parser/releases/tag/v1.20.6) via [#698](https://github.com/expressjs/body-parser/pull/698). After the fix, invalid `limit` values throw a clear error at parser construction time instead of silently disabling enforcement. `null` and `undefined` continue to fall back to the default limit (`100kb`).\n\n### Workarounds\n\nValidate `limit` before passing it to body-parser. For example, parse the value with [`bytes.parse()`](https://github.com/visionmedia/bytes.js) at startup and reject any configuration where it returns `null` or a non-finite number.\n\n### References\n\n- [#698](https://github.com/expressjs/body-parser/pull/698): fix PR\n- [bytes.js](https://github.com/visionmedia/bytes.js): limit parser",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "body-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.20.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "body-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/security/advisories/GHSA-v422-hmwv-36x6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12590"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/pull/698"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/pull/741"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/commit/2322e111cc321413ec2b7b76d01be533d3de9d7d"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/commit/3492672eee593d5c158f239b6e9115498a5dbeac"
}, {
"type" : "WEB",
"url" : "https://cna.openjsf.org/security-advisories.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/expressjs/body-parser"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/releases/tag/1.20.6"
}, {
"type" : "WEB",
"url" : "https://github.com/expressjs/body-parser/releases/tag/v2.3.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-20T23:23:26Z",
"nvd_published_at" : "2026-07-09T11:16:24Z"
}
}