Jul 21, 2026·6 min read·53 visits
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).
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.
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.
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.limitIf '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 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/uploadAs 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.
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.
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.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
body-parser OpenJS Foundation | < 1.20.6 | 1.20.6 |
body-parser OpenJS Foundation | >= 2.0.0 < 2.3.0 | 2.3.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-770 |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 | 3.7 (Low) |
| EPSS Score | 0.0025 (Percentile: 16.43%) |
| Exploit Status | PoC-only |
| CISA KEV Status | Not Listed |
Allocation of Resources Without Limits or Throttling
SurrealDB versions supporting element-level SELECT permissions on arrays are vulnerable to a logical authorization bypass. Due to an index-shifting error during array filtration, restricted elements can skip permission checks and leak to unauthorized record users.
CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.
CVE-2026-73654 is a high-severity prototype pollution vulnerability in Trigger.dev. The flaw occurs during the handling of run-metadata updates through the PUT /api/v1/runs/:runId/metadata endpoint. Because user-supplied keys are parsed directly by the @jsonhero/path library without sanitization, an authenticated attacker with low privileges can pollute the global Object.prototype. This causes database queries via Prisma ORM to fail validation and induces unhandled exceptions in the Prometheus metrics client, resulting in a process-wide denial of service.
CVE-2026-73559 is an uncontrolled resource consumption vulnerability in the vLLM engine, specifically within the /v1/completions API endpoint, allowing authenticated attackers to cause application-level denial of service via unbounded prompt arrays.
A critical security bypass vulnerability in Argo Workflows allows authenticated attackers with workflow submission privileges to bypass 'Strict' or 'Secure' template referencing restrictions. By injecting unvalidated fields into the nested ArtifactGC configuration, attackers can execute arbitrary pod patches, leading to host namespace escape and cluster-wide privilege escalation.
A Server-Side Request Forgery (SSRF) / Confused Deputy vulnerability has been identified in Pydantic AI UI Adapters (such as VercelAIAdapter). Under certain conditions, a malicious client can supply manipulated message history with provider metadata that forces the server to resolve files within privileged cloud environments (AWS S3, Google Cloud Storage) or model providers. This occurs because the adapters deserialize client-provided metadata structures directly into UploadedFile instances without validation, which are subsequently fetched using high-privilege server credentials.