CVE-2026-12590: body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement

Published Jul 9, 2026
·
Updated

Impact

When 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.

This issue affects applications that pass a programmatically computed or user-configurable value to the limit option without validating it first.

Patches

This issue is fixed in body-parser@2.3.0 and body-parser@1.20.6 via #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).

Workarounds

Validate limit before passing it to body-parser. For example, parse the value with bytes.parse() at startup and reject any configuration where it returns null or a non-finite number.

References

- #698: fix PR - bytes.js: limit parser

Other sources

Impact: In body-parser versions prior to 1.20.6 (1.x line) and 2.3.0 (2.x line), when the 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. Patches: This issue is fixed in body-parser 1.20.6 and 2.3.0. After the fix, invalid limit values throw a clear error at parser construction time instead of silently disabling enforcement, while null and undefined continue to fall back to the default limit of 100kb. Workarounds: Validate the limit value before passing it to body-parser. For example, parse the value at startup and reject any configuration where the result is null or a non-finite number.

NVD

Affected Software

6 affected componentsFixes available
npm/body-parser<1.20.6, >1.20.5<1.20.6
npm/body-parser<2.3.0
Openjsf Body-parser Node.js<1.20.6
Openjsf Body-parser Node.js>=2.0.0<2.3.0
npm/body-parser>=2.0.0<2.3.0
2.3.0
npm/body-parser<1.20.6
1.20.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/body-parser to a version that resolves this vulnerability.

    Fixed in 2.3.0
  2. Upgrade

    Upgrade npm/body-parser to a version that resolves this vulnerability.

    Fixed in 1.20.6
  3. Upgrade

    Upgrade body-parser to a version that resolves this vulnerability.

    Fixed in 1.20.6
  4. Upgrade

    Upgrade body-parser to a version that resolves this vulnerability.

    Fixed in 2.3.0
  5. Configuration

    Before passing the `limit` option to body-parser, parse the configured value at startup with bytes.parse() and reject the configuration if it returns `null` or a non-finite number (e.g., NaN). Note: `null` and `undefined` should continue to fall back to the default limit (`100kb`).

    body-parser limit = validated bytes.parse(limit) is not null and is finite (non-NaN); reject invalid values

Event History

Jul 9, 2026
CVE Published
via MITRE·10:21 AM
Data Sourced
via MITRE·10:21 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 20, 2026
Advisory Published
via GitHub·11:23 PM
Data Sourced
via GitHub·11:23 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-12590?

The severity of CVE-2026-12590 is rated as low at 3.7.

2

How do I fix CVE-2026-12590?

To fix CVE-2026-12590, update body-parser to version 1.20.6 or higher in the 1.x line, or 2.3.0 or higher in the 2.x line.

3

What impact does CVE-2026-12590 have on applications?

CVE-2026-12590 can lead to a denial of service by bypassing the request body size limit when invalid limit values are used.

4

Which versions of body-parser are affected by CVE-2026-12590?

Versions of body-parser prior to 1.20.6 in the 1.x line and 2.3.0 in the 2.x line are affected by CVE-2026-12590.

5

What should I monitor for due to CVE-2026-12590?

Monitor your applications for potential denial of service issues related to request body size checks if using the vulnerable versions of body-parser.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203