CVE-2024-55602

7.6 HIGH

📋 TL;DR

This vulnerability in PwnDoc allows authenticated users with template update/download permissions to perform path traversal attacks by injecting '../' sequences into file extension properties. This enables reading arbitrary files on the server filesystem. Only authenticated users with specific template permissions are affected.

💻 Affected Systems

Products:
  • PwnDoc
Versions: All versions prior to commit 1d4219c596f4f518798492e48386a20c6e9a2fe6
Operating Systems: All platforms running PwnDoc
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user with template update/download permissions. Default installations with default user roles may be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker could read sensitive system files including configuration files, passwords, SSH keys, and other credentials, potentially leading to full system compromise.

🟠

Likely Case

Attackers with legitimate user accounts could exfiltrate sensitive report data, user information, or configuration details from the PwnDoc application directory.

🟢

If Mitigated

With proper access controls and network segmentation, impact would be limited to files accessible by the PwnDoc application user.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploit requires authenticated access but is simple to execute once authentication is obtained. Public proof-of-concept available in GitHub gist.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit 1d4219c596f4f518798492e48386a20c6e9a2fe6 or later

Vendor Advisory: https://github.com/pwndoc/pwndoc/security/advisories/GHSA-2mqc-gg7h-76p6

Restart Required: Yes

Instructions:

1. Update to latest PwnDoc version or apply commit 1d4219c596f4f518798492e48386a20c6e9a2fe6
2. Restart the PwnDoc application
3. Verify the fix by checking the template.js file contains proper path validation

🔧 Temporary Workarounds

Restrict Template Permissions

all

Remove template update and download permissions from all non-admin users

Application Sandboxing

linux

Run PwnDoc in a container or chroot jail with minimal file system access

🧯 If You Can't Patch

  • Implement strict access controls to limit which users can update/download templates
  • Monitor file access logs for suspicious path traversal patterns

🔍 How to Verify

Check if Vulnerable:

Check if your PwnDoc version is prior to commit 1d4219c596f4f518798492e48386a20c6e9a2fe6 by examining the backend/src/routes/template.js file for path traversal validation

Check Version:

git log --oneline -1

Verify Fix Applied:

Verify that backend/src/routes/template.js contains proper path sanitization and validation for file extension parameters

📡 Detection & Monitoring

Log Indicators:

  • Unusual file access patterns from template endpoints
  • Requests containing '../' sequences in template parameters

Network Indicators:

  • Multiple template download requests with varying file extensions

SIEM Query:

source="pwndoc" AND (uri_path="/api/templates/*" AND (param="../" OR param="..\\"))

🔗 References

📤 Share & Export