CVE-2024-25180
Executive Summary
CVE-2024-25180 describes a disputed vulnerability in pdfmake version 0.2.9. The issue involves the /pdf endpoint, which is part of a test framework that is not included in the core pdfmake application. An attacker could send a crafted POST request to this endpoint to execute arbitrary code. The vendor disputes this, stating that the endpoint is only available after intentionally installing the test framework and that access should be restricted to authorized testers. The CVSS score is 0.0, and no public exploit code or proof-of-concept is available. The risk is considered low due to the intentional nature of the endpoint and the requirement for manual installation.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
pdfmake is an npm package used for generating PDFs. The disputed vulnerability does not affect the core library but rather an optional test framework. Users who install pdfmake via npm do not automatically get the /pdf endpoint. The risk is limited to environments where the test framework is explicitly installed and exposed to untrusted networks.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Disputed)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The CVSS score is 0.0 because the vulnerability is disputed and the endpoint is not part of the core application. The threat level is low, but if the test framework is installed and exposed, the impact could be critical.
Deep Dive & Mechanics
The /pdf endpoint in pdfmake's test framework accepts POST requests. The endpoint is designed to generate PDFs for testing purposes. However, due to insufficient input validation, an attacker can inject arbitrary code that gets executed on the server. The code execution occurs because the endpoint processes user-supplied data without proper sanitization, allowing for server-side template injection or similar attacks.
The vulnerability is disputed because the test framework is not part of the core pdfmake application. It must be manually installed, and the vendor argues that anyone installing it should ensure it is only accessible to authorized testers.
Vulnerable vs. Patched Code
Vulnerable Code (pdfmake 0.2.9 test framework):
// Example of vulnerable endpoint handling
app.post('/pdf', (req, res) => {
const userInput = req.body.data;
// Directly evaluating user input without sanitization
const result = eval(userInput);
res.send(result);
});
Patched Code (hypothetical):
// Example of patched endpoint with input validation
app.post('/pdf', (req, res) => {
const userInput = req.body.data;
// Sanitize and validate input
if (typeof userInput !== 'string' || userInput.length > 1000) {
return res.status(400).send('Invalid input');
}
// Use safe parsing instead of eval
const result = safeParse(userInput);
res.send(result);
});
No official patch exists because the vendor considers the behavior intentional.
Exploitation & Lab Setup
Red Team
- Setup: Install pdfmake 0.2.9 and the test framework on a vulnerable server.
- Reconnaissance: Identify the
/pdfendpoint using directory brute-forcing or by reviewing documentation. - Exploitation: Send a crafted POST request to the
/pdfendpoint with malicious payload.curl -X POST http://target:port/pdf -H "Content-Type: application/json" -d '{"data":"require(\"child_process\").execSync(\"id\")"}' - Post-Exploitation: Execute arbitrary commands to gain persistence or exfiltrate data.
Blue Team
- Detection: Monitor for POST requests to
/pdfendpoint with unusual payloads. - Prevention: Restrict access to the
/pdfendpoint using firewall rules or authentication. - Response: If exploitation is detected, isolate the server and review logs for unauthorized access.
Indicators of Compromise (IOCs)
- Network: POST requests to
/pdfendpoint with JSON payloads containingeval,require, orexec. - File System: Unexpected files in the pdfmake test framework directory.
- Process: Unusual child processes spawned by the Node.js application.
Detection Engineering
YARA Rule
Sigma Rule
Suricata Rule
Remediation & Mitigation
- Do not install the test framework in production environments.
- Restrict access to the
/pdfendpoint using network segmentation or authentication. - Monitor logs for suspicious POST requests to
/pdf. - Apply input validation if the test framework is required for development.
- Consider using a WAF to block malicious payloads.
Valters IT
Security researchers use these queries on Shodan.io to find vulnerable systems globally.
Full Shodan queries for this CVE are available through the ValtersIT API. They were moved behind the API in response to large-scale automated scraping, and to keep this independently-researched intelligence sustainable. The written analysis above remains fully open.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.