body-parser, Denial of Service, CVE-2025-XXXX (Moderate)

Listen to this Post

How the mentioned CVE works:

The vulnerability CVE-2025-XXXX in body-parser version 2.2.0 stems from an inefficient algorithm for parsing URL-encoded request bodies. When an attacker sends a POST request with a high number of parameters (e.g., thousands of key-value pairs) that stays within the default 100KB size limit, the parsing function enters a state of high computational complexity. This occurs because the function processing the `application/x-www-form-urlencoded` content type uses a method with quadratic time complexity relative to the number of parameters. Parsing such a crafted payload consumes excessive CPU cycles and allocates significant memory, leading to prolonged event loop blocking. This resource exhaustion makes the Node.js server unresponsive to other legitimate requests, effectively causing a denial-of-service condition without requiring a large volume of malicious traffic.
Platform: Node.js
Version: 2.2.0
Vulnerability : DoS
Severity: Moderate
date: 2025-11-24

Prediction: 2025-11-30

What Undercode Say:

Simulating a request with a large number of parameters
for i in {1..5000}; do echo -n "key$i=value$i&"; done > payload.txt
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --data-binary "@payload.txt" http://localhost:3000/
// Example vulnerable code path in body-parser
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true })); // Vulnerable version 2.2.0
// Attacker-controlled payload with many parameters
// key1=val1&key2=val2& ... &keyN=valN

How Exploit:

Craft a URL-encoded POST request containing thousands of parameters within the 100KB limit. Send this request repeatedly to the target endpoint to exhaust server CPU and memory, causing service degradation or unavailability for other users.

Protection from this CVE:

Upgrade to body-parser version 2.2.1 immediately. The patch optimizes the parsing algorithm, reducing its time complexity and preventing the CPU exhaustion. Implement rate limiting on endpoints to mitigate abuse. Use a reverse proxy or WAF to filter and block requests with an abnormally high parameter count before they reach the application.

Impact:

Service slowdown, partial outages, and degraded performance due to excessive CPU and memory consumption, leading to denial-of-service for legitimate users under sustained attack.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top