CVE-2020-13450

9.8 CRITICAL

📋 TL;DR

CVE-2020-13450 is a critical directory traversal vulnerability in Gotenberg's file upload function that allows attackers to upload and overwrite files outside intended directories. This affects Gotenberg versions through 6.2.1 and can lead to denial of service, program behavior changes, or remote code execution. Organizations using vulnerable Gotenberg instances for document conversion services are at risk.

💻 Affected Systems

Products:
  • Gotenberg
Versions: through 6.2.1
Operating Systems: All platforms running Gotenberg
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using the vulnerable file upload function are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

File system corruption, denial of service, or unauthorized file modifications affecting application functionality.

🟢

If Mitigated

Limited impact with proper file permission restrictions and network segmentation.

🌐 Internet-Facing: HIGH - Exploitable remotely without authentication, allowing external attackers to compromise systems.
🏢 Internal Only: HIGH - Even internal attackers could exploit this to escalate privileges or disrupt services.

🎯 Exploit Status

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

Proof-of-concept exploit code is publicly available, making exploitation straightforward for attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.2.2 and later

Vendor Advisory: https://github.com/thecodingmachine/gotenberg/issues/199

Restart Required: Yes

Instructions:

1. Stop Gotenberg service. 2. Update to version 6.2.2 or later. 3. Restart Gotenberg service. 4. Verify the fix by testing file upload functionality.

🔧 Temporary Workarounds

File Permission Restrictions

linux

Set strict file permissions on directories outside Gotenberg's intended upload folder

chmod 755 /path/to/restricted/directories
chown root:root /path/to/restricted/directories

Network Segmentation

linux

Isolate Gotenberg instances from critical systems using firewall rules

iptables -A INPUT -p tcp --dport 3000 -s trusted_network -j ACCEPT
iptables -A INPUT -p tcp --dport 3000 -j DROP

🧯 If You Can't Patch

  • Disable file upload functionality entirely if not required
  • Implement web application firewall (WAF) rules to block directory traversal patterns

🔍 How to Verify

Check if Vulnerable:

Check if Gotenberg version is 6.2.1 or earlier by examining the service version or container image tag

Check Version:

docker inspect gotenberg:tag | grep -i version OR check Gotenberg API endpoint /health

Verify Fix Applied:

Test file upload with directory traversal payloads (e.g., '../../etc/passwd') - should be rejected in patched versions

📡 Detection & Monitoring

Log Indicators:

  • File upload requests containing '../' sequences
  • Unauthorized file write attempts outside upload directory
  • Unexpected file modifications in system directories

Network Indicators:

  • HTTP POST requests to upload endpoints with path traversal payloads
  • Unusual outbound connections from Gotenberg instance

SIEM Query:

source="gotenberg" AND (http_method="POST" AND (url="*upload*" AND request_body="*../*"))

🔗 References

📤 Share & Export