Skip to content

chore(deps): update dependency body-parser to v2.4.0 [security] - #199

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-body-parser-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-body-parser-vulnerability

Conversation

@renovate

@renovate renovate Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
body-parser 2.2.0 → 2.4.0 age confidence

body-parser is vulnerable to denial of service when url encoding is used

CVE-2025-13466 / GHSA-wqch-xfxh-vrr4

More information

Details

Impact

body-parser 2.2.0 is vulnerable to denial of service due to inefficient handling of URL-encoded bodies with very large numbers of parameters. An attacker can send payloads containing thousands of parameters within the default 100KB request size limit, causing elevated CPU and memory usage. This can lead to service slowdown or partial outages under sustained malicious traffic.

Patches

This issue is addressed in version 2.2.1.

Severity

  • CVSS Score: 5.5 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L/E:P

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


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

CVE-2026-12590 / GHSA-v422-hmwv-36x6

More information

Details

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

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


body-parser vulnerable to Denial of Service via trailing bytes after a compressed request body

CVE-2026-111181 / GHSA-27r3-jxmh-p828

More information

Details

Impact

A single request can crash any application using body-parser with default options. When a request carries a Content-Encoding (for example gzip), body-parser pipes it into a decompression stream and, after reading the body, leaves that stream piped with no error listener. A payload of one valid compressed frame followed by trailing bytes decodes and the application responds normally, but the trailing bytes then reach the already-finished decoder, which emits an error that is re-thrown as an uncaught exception and terminates the process. No authentication or matching route is required, since parsing runs before routing.

Patches

Fixed in body-parser 2.4.0 and 1.20.9. Upgrade to one of these versions.

Workarounds

Pass inflate: false to the body-parser middleware if the application does not need to accept compressed request bodies. This rejects encoded requests before any decompression stream is created.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

expressjs/body-parser (body-parser)

v2.4.0

Compare Source

=====

  • Security fix for GHSA-27r3-jxmh-p828 (CVE-2026-111181)
  • feat: add zstd content-encoding support (#​586)
    • Requires Node.js ^22.15.0 or >=23.8.0; older versions keep returning 415 for zstd encoded bodies
  • fix: avoid mutating the parser options and the request object while reading the body (#​742, #​750)
  • perf(json): avoid first-char regex for direct JSON bodies (#​744)
  • deps:
    • content-type@^2.1.0
    • iconv-lite^0.7.3
    • qs@^6.16.1

v2.3.0

Compare Source

=====

  • Security fix for GHSA-v422-hmwv-36x6
  • fix: use static exports instead of lazy getters to improve ESM compatibility
  • feat: add subpath exports for individual parsers
  • fix: improve limit option validation (#​698)
    • Invalid limit values (e.g. unparseable strings or NaN) now throw instead of being silently ignored, which previously disabled size limit enforcement
    • null and undefined fall back to the default 100kb limit
  • deps:
    • content-type@^2.0.0
    • http-errors@^2.0.1
    • iconv-lite^0.7.2
    • qs@^6.15.2
    • raw-body@^3.0.2
    • type-is@^2.1.0

v2.2.2

Compare Source

=====

  • deps: qs@^6.14.1
  • refactor(json): simplify strict mode error string construction

v2.2.1

Compare Source

=====

  • Security fix for GHSA-wqch-xfxh-vrr4
  • deps:
    • type-is@^2.0.1
    • iconv-lite@^0.7.0
      • Handle split surrogate pairs when encoding UTF-8
      • Avoid false positives in encodingExists by using prototype-less objects
    • raw-body@^3.0.1
    • debug@^4.4.3

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch 2 times, most recently from 3c4c9c8 to f820322 Compare May 31, 2026 10:48
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch 4 times, most recently from 1c61081 to 6d6deef Compare June 10, 2026 01:17
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from 6d6deef to 288ba31 Compare June 23, 2026 10:32
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from 288ba31 to d28dccf Compare July 12, 2026 13:43
@renovate renovate Bot changed the title chore(deps): update dependency body-parser to v2.2.1 [security] chore(deps): update dependency body-parser to v2.3.0 [security] Aug 26, 2026
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from d28dccf to 22606cb Compare August 26, 2026 13:45
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from 22606cb to f39d957 Compare September 3, 2026 01:03
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from f39d957 to 2abb657 Compare October 20, 2026 12:26
@renovate renovate Bot changed the title chore(deps): update dependency body-parser to v2.3.0 [security] chore(deps): update dependency body-parser to v2.4.0 [security] Oct 29, 2026
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from 2abb657 to 8ee299b Compare October 29, 2026 12:42
@renovate
renovate Bot force-pushed the renovate/npm-body-parser-vulnerability branch from 8ee299b to 5a46262 Compare November 20, 2026 21:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants