CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-12590

CVE-2026-12590: Fail-Open Limit Enforcement Vulnerability in body-parser

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 21, 2026·6 min read·8 visits

Executive Summary (TL;DR)

Unparseable limit configurations in the body-parser middleware fail open silently. Attackers can exploit this to send massive requests, exhausting server memory and crashing the Node.js process.

A vulnerability in the 'body-parser' Node.js middleware allows unauthenticated attackers to trigger a Denial of Service. When the 'limit' configuration option is misconfigured with an unparseable type or empty value, size limits fail open. This leads to unrestricted heap memory allocation and process crash via Out of Memory (OOM).

Vulnerability Overview

The open-source 'body-parser' module acts as request-parsing middleware for Node.js and is standard in Express-based applications. It parses incoming request bodies before they reach application route handlers, populating the 'req.body' property. Because this middleware handles incoming network streams, it exposes a critical attack surface that requires strict resource controls.

To prevent resource exhaustion, developers specify a 'limit' parameter to enforce maximum payload sizes. This limit restricts the buffer size allocated during request handling. Under standard operations, any request exceeding this configured limit is rejected with a 413 Payload Too Large HTTP response.

This security control depends on successful configuration parsing. When body-parser initializes with an invalid, unparseable, or empty 'limit' value, the validation fails open. Rather than stopping server execution or defaulting to a secure restriction, the middleware disables boundary checks, exposing the host to denial of service.

Root Cause Analysis

The root cause of this vulnerability lies in how configuration variables are normalized during middleware initialization. In affected versions of body-parser, the module delegates input evaluation to the 'bytes.parse()' utility library. If this library receives an unparseable string, boolean, empty string, or object, it returns 'null' instead of throwing an error.

Downstream verification logic does not validate whether the parsed output is a valid number before application execution. When the internal parser receives a request, it performs checks to evaluate the stream length against the limit configuration. If 'limit' resolves to 'null', the size check skips boundary enforcement and allows data streams of any size to be parsed.

If the configuration value resolves to 'NaN' (Not-a-Number), the comparison checks fail similarly. Every numerical comparison against 'NaN' evaluates to false. Consequently, comparisons designed to detect if a request length exceeds the limit resolve to false, allowing arbitrary size payloads to bypass memory allocation restrictions.

Code Analysis

In vulnerable versions (such as '1.20.5'), the initialization utility normalizes the input using the following logic:

// Vulnerable logic in body-parser <= 1.20.5
var limit = typeof opts.limit !== 'number'
  ? bytes.parse(opts.limit || '100kb')
  : opts.limit

If 'opts.limit' evaluates to an invalid type (such as an object or boolean), 'bytes.parse()' returns 'null'. The variable 'limit' becomes 'null', disabling subsequent safety checks inside the 'raw-body' module.

To address this issue, the security patch refactors how values are parsed and explicitly validates the output during middleware configuration:

// Patched logic in body-parser 1.20.6
var limit = typeof opts.limit === 'undefined' || opts.limit === null
  ? 102400 // Safe 100kb default value
  : bytes.parse(opts.limit)
 
// Fail-safe validation check
if (limit === null) {
  throw new TypeError('option limit "' + String(opts.limit) + '" is invalid')
}

By adding this condition, the updated middleware enforces a fail-fast behavior. If the 'limit' configuration is invalid or unparseable, the application throws a 'TypeError' during initialization, halting the startup sequence. This ensures that the application cannot enter a vulnerable, running state.

Exploitation Methodology

Exploitation relies on a misconfigured system where a developer has specified an invalid or typo-ridden limit parameter. Attackers can identify endpoints that parse JSON, urlencoded, or raw payloads by auditing common routes. No authentication or elevated privileges are required to issue the exploit payload.

Once a vulnerable endpoint is identified, the attacker crafts an exceptionally large HTTP POST request. By avoiding standard JSON field limits, the attacker streams a high-volume request body to the target. This request bypasses the size check and forces the V8 engine to allocate heap memory to buffer the payload.

To execute this process exhaustion attack, the client generates a local payload and transmits it over the network to the application server:

# Generate a 100MB dummy payload file
dd if=/dev/zero bs=1M count=100 | tr '\0' 'A' > massive_payload.json
 
# Transmit payload to the target endpoint
curl -X POST -H "Content-Type: application/json" -d @massive_payload.json http://target-app:3000/upload

As the server attempts to buffer the incoming characters into memory, garbage collection thrashing increases. The V8 heap eventually runs out of available space, resulting in an unrecoverable process crash.

Impact Assessment

The primary impact of this vulnerability is a complete denial of service. Because Node.js operates on a single-thread event loop, excessive garbage collection activity blocks other incoming requests. When heap memory is exhausted, the Node.js runtime environment exits immediately with an Out-Of-Memory status.

In containerized or orchestrated environments, crash-loop backoffs may mitigate individual node failures, but continuous exploitation will exhaust orchestrator pool resources. If the application is not configured with process monitoring and automatic restart routines, manual administrator intervention is necessary to restore system availability.

While CVSS rates this vulnerability with a low impact due to the specific pre-configuration requirement, the real-world impact in production systems that consume variable configuration parameters is significant. Applications relying on unvalidated environment variables for horizontal scaling are highly susceptible to this configuration weakness.

Remediation and Code Hardening

The most effective remediation is upgrading the body-parser package to a secure version. Applications built on the '1.x' branch must upgrade to version '1.20.6' or later. Applications built on the '2.x' branch must upgrade to version '2.3.0' or later.

When immediate patching is restricted by organizational constraints, developers must implement configuration sanitation wrappers. Environment variables and custom configuration schemas must be verified to ensure they represent valid numeric values or conform to strict byte-size formats before they are passed to the middleware setup.

const bytes = require('bytes');
 
function getSafeLimit(val) {
  if (val === undefined || val === null) return '100kb';
  const parsed = bytes.parse(val);
  if (parsed === null || !Number.isFinite(parsed)) {
    throw new Error('Critical Configuration Failure: Invalid body-parser limit value');
  }
  return val;
}
 
// Safe middleware registration
app.use(bodyParser.json({ limit: getSafeLimit(process.env.REQUEST_LIMIT) }));

Additionally, static analysis tooling and custom dependency-scanning rules must be implemented. Scanners should flag dynamic assignments to 'limit' within middleware registrations to ensure configurations remain deterministic and secure.

Official Patches

OpenJS FoundationGitHub Security Advisory GHSA-v422-hmwv-36x6

Fix Analysis (2)

Technical Appendix

CVSS Score
3.7/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.25%
Top 84% most exploited

Affected Systems

Applications utilizing Express.js with body-parserNode.js software packages with body-parser dependencies prior to 1.20.6Node.js software packages with body-parser dependencies starting at 2.0.0 and prior to 2.3.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
body-parser
OpenJS Foundation
< 1.20.61.20.6
body-parser
OpenJS Foundation
>= 2.0.0 < 2.3.02.3.0
AttributeDetail
CWE IDCWE-770
Attack VectorNetwork (AV:N)
CVSS v3.13.7 (Low)
EPSS Score0.0025 (Percentile: 16.43%)
Exploit StatusPoC-only
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

Allocation of Resources Without Limits or Throttling

Vulnerability Timeline

Initial fix commit 2322e111cc321413ec2b7b76d01be533d3de9d7d addresses validation logic in utilities
2026-03-04
Refinement commit 3492672eee593d5c158f239b6e9115498a5dbeac integrates fixed logic to parser subsystems
2026-07-07
Official Advisory and CVE-2026-12590 publication
2026-07-09

References & Sources

  • [1]GitHub Security Advisory: body-parser Denial of Service vulnerability
  • [2]OpenJS Foundation Security Advisories
  • [3]NVD - CVE-2026-12590 Detailed Report
  • [4]CVE-2026-12590 Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-59197
8.2

CVE-2026-59197: Heap Out-of-Bounds Write and Division-by-Zero in Pillow libImaging

A heap out-of-bounds write vulnerability exists in Pillow prior to version 12.3.0 due to an integer overflow during image expansion calculations. The subsequent patch introduced a division-by-zero regression causing denial of service.

Alon Barad
Alon Barad
1 views•3 min read
•about 2 hours ago•CVE-2026-59198
6.5

CVE-2026-59198: Heap Out-of-Bounds Read in Pillow TGA RLE Encoder

CVE-2026-59198 is a high-severity heap out-of-bounds read vulnerability in Pillow, the Python imaging library, affecting versions from 5.2.0 up to 12.3.0. The vulnerability occurs in the TGA RLE compression path due to a calculation mismatch between the allocated packed 1-bit row buffer and the byte-level pixel stride assumption in the C-level encoder. This mismatch allows an attacker to leak up to approximately 57 KB of adjacent process heap memory directly into generated TGA image files.

Alon Barad
Alon Barad
2 views•8 min read
•about 3 hours ago•CVE-2026-59199
7.5

CVE-2026-59199: Signed 32-Bit Integer Overflow and Heap Backward Underwrite in Pillow

A critical signed 32-bit integer overflow vulnerability was identified in Pillow (Python Imaging Library) versions prior to 12.3.0. The vulnerability resides within the native C extension library (libImaging) during coordinate and bounding box calculations in functions like ImagingPaste and ImagingFill2. Exploitation can bypass bounds and clipping safety checks, leading to a controlled heap backward underwrite and application crash.

Alon Barad
Alon Barad
6 views•6 min read
•about 4 hours ago•CVE-2026-59200
7.5

CVE-2026-59200: Remote Denial of Service via PDF Decompression Bomb in Pillow

CVE-2026-59200 is a high-severity uncontrolled resource consumption vulnerability in the Pillow Python Imaging Library. The flaw resides in the PDF stream decoder, allowing remote, unauthenticated attackers to trigger host out-of-memory crashes by submitting malicious PDF decompression bombs.

Alon Barad
Alon Barad
6 views•5 min read
•about 5 hours ago•CVE-2026-59203
5.3

CVE-2026-59203: Denial of Service via Infinite Loop in Pillow EPS Image Parser

A denial-of-service (DoS) vulnerability in Pillow (Python Imaging Library) versions 12.0.0 through 12.2.0 allows unauthenticated remote attackers to trigger 100% CPU utilization and hang the processing thread. The issue occurs within the Encapsulated PostScript (EPS) image parser (PIL/EpsImagePlugin.py) due to missing validation on the byte count parsed from %%BeginBinary: comments, allowing negative values to cause an infinite backward stream seek loop. This formatting-level state-looping issue occurs during the initial format sniffing phase inside Image.open() and does not require the system Ghostscript interpreter to be executed or present. It is resolved in version 12.3.0.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 6 hours ago•CVE-2026-59204
7.5

CVE-2026-59204: Denial of Service via Memory Exhaustion in Pillow JPEG2000 Decoder

A Denial of Service vulnerability exists in the JPEG2000 decoder of Pillow (versions 8.2.0 to 12.2.0) due to memory allocation state accumulation across tiles, leading to rapid process termination.

Amit Schendel
Amit Schendel
9 views•7 min read