CVE-2024-55653
Executive Summary
CVE-2024-55653 is a denial-of-service (DoS) vulnerability in PwnDoc, a penetration test report generator. An authenticated user can crash the backend by triggering an unhandled promise rejection, which exits the Node.js process. This makes the entire application unavailable to all users. The vulnerability exists in versions up to and including 0.5.3. No patch is currently available.
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
PwnDoc is a Node.js application. The vulnerability is a logic flaw in the application's error handling, not a dependency issue. However, the lack of a patch means that users must rely on workarounds or custom patches. The application's dependencies should be reviewed for any related issues, but the core problem is in the application code itself.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (authenticated user)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: High
The vulnerability is rated Medium due to the requirement for authentication and the lack of data confidentiality or integrity impact. However, the availability impact is high, making the application completely unusable.
Deep Dive & Mechanics
The vulnerability lies in the audit handling logic of PwnDoc. When an authenticated user interacts with an audit (e.g., by providing a malformed or non-existent audit ID), the application throws an unhandled promise rejection. In Node.js, unhandled promise rejections can cause the process to exit, especially in older versions or when the --unhandled-rejections=strict flag is not set. This results in a complete denial of service.
The root cause is the lack of proper error handling in asynchronous functions that process audit-related requests. Instead of catching the rejection and returning an appropriate error response, the error propagates to the top level, crashing the backend.
Vulnerable vs. Patched Code
Vulnerable Code (PwnDoc <= 0.5.3):
// Example of vulnerable audit handler
app.get('/api/audit/:id', async (req, res) => {
const audit = await Audit.findById(req.params.id);
// If audit is null or findById throws, this becomes an unhandled rejection
res.json(audit);
});
Patched Code (Hypothetical fix):
// Patched version with proper error handling
app.get('/api/audit/:id', async (req, res) => {
try {
const audit = await Audit.findById(req.params.id);
if (!audit) {
return res.status(404).json({ error: 'Audit not found' });
}
res.json(audit);
} catch (error) {
console.error('Error fetching audit:', error);
res.status(500).json({ error: 'Internal server error' });
}
});
The fix involves wrapping the async operation in a try-catch block and handling errors gracefully, preventing the unhandled rejection from crashing the process.
Exploitation & Lab Setup
Red Team
- Setup: Deploy a vulnerable instance of PwnDoc (version 0.5.3) in a controlled lab environment.
- Authentication: Obtain valid credentials for a user account.
- Exploit: Send a crafted request to an audit endpoint with an invalid or malformed audit ID.
# Example using curl
curl -X GET http://target:3000/api/audit/invalid-id \
-H "Authorization: Bearer <valid_token>"
- Observation: The backend process crashes, and the application becomes unresponsive. All subsequent requests fail.
Blue Team
- Detection: Monitor for a sudden spike in 500 errors or process crashes in the application logs.
- Mitigation: Implement a reverse proxy (e.g., Nginx) with rate limiting and request validation to filter malformed requests.
- Workaround: Add a global error handler in the application code to catch unhandled rejections.
// Add to the main application file
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
// Optionally, keep the process alive
});
Indicators of Compromise (IOCs)
- Log Entry:
UnhandledPromiseRejectionWarning: Error: ...in application logs. - Network: Repeated requests to
/api/audit/with invalid IDs from a single authenticated user. - System: Backend process exits unexpectedly, leaving a core dump or crash log.
Detection Engineering
YARA Rule
rule CVE_2024_55653_PwnDoc_DoS {
meta:
description = "Detects unhandled promise rejection patterns in PwnDoc logs"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-55653"
strings:
$rejection = "UnhandledPromiseRejectionWarning"
$audit = "/api/audit/"
condition:
$rejection and $audit
}
Sigma Rule
title: PwnDoc Unhandled Promise Rejection DoS
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects unhandled promise rejection errors in PwnDoc logs
author: Valters IT
date: 2024-01-01
logsource:
category: application
product: pwnDoc
detection:
selection:
message: "*UnhandledPromiseRejectionWarning*"
condition: selection
falsepositives:
- Legitimate application errors (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-55653 PwnDoc DoS Attempt"; flow:to_server; content:"GET"; http_method; content:"/api/audit/"; http_uri; pcre:"/\/api\/audit\/[^a-f0-9]/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Add a global unhandled rejection handler to the application to prevent crashes.
- Short-term: Implement input validation and proper error handling in all audit-related endpoints.
- Long-term: Upgrade to a patched version once available. Monitor the PwnDoc repository for updates.
- Workaround: Use a reverse proxy (e.g., Nginx) to filter requests with invalid audit IDs and rate-limit authenticated users.
Valters IT
DevSecOps & Cyber Threat Intelligence