apidoc-core, Prototype Pollution, CVE-2025-4255 (High)

Listen to this Post

The vulnerability, CVE-2025-4255, exists in the `preProcess` function of apidoc-core versions up to and including 0.15.0. This function is responsible for parsing and processing API documentation blocks. The flaw is a prototype pollution vulnerability, which occurs when an application does not properly sanitize user-input that is used to modify JavaScript objects. By supplying a specially crafted payload within an API documentation block, an attacker can inject properties into the base Object.prototype. Since nearly all objects in JavaScript inherit from this prototype, the injected properties will be present on every object. This can lead to a denial-of-service (DoS) condition by causing the application to crash or behave unpredictably when it encounters these unexpected properties during execution. The pollution happens during the parsing phase, meaning any application generating documentation from untrusted sources using a vulnerable version is at risk.
Platform: Node.js
Version: thru 0.15.0
Vulnerability: Prototype Pollution
Severity: High

date: 2025-09-25

Prediction: Patch by 2025-10-09

What Undercode Say:

Searching for the vulnerable function in the codebase
grep -r "preProcess" --include=".js" node_modules/apidoc-core/
Example of a potentially malicious payload in an apidoc block
/
@api {get} /test Polluting Payload
@apiParam <strong>proto</strong>.polluted "yes"
/

How Exploit:

An attacker can create a malicious API documentation file containing a payload designed to pollute the prototype. When `apidoc` is run on this file, the `preProcess` function incorrectly assigns the nested property to the global object prototype.

// Crafted payload in an apidoc comment pollutes Object.prototype
// @apiParam <strong>proto</strong>.isAdmin true
// After processing, every object will have an 'isAdmin' property.

Protection from this CVE

Immediately upgrade apidoc-core to a version beyond 0.15.0 once a patch is released. Until then, avoid processing apidoc source files from untrusted sources. Implement input sanitization for any data passed to the apidoc tool.

Impact:

Denial of Service (DoS) is the primary impact, as the application may crash or become unstable. If the application logic relies on object properties without proper checks, prototype pollution could potentially lead to more severe consequences like authorization bypasses.

🎯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