CVE-2022-31509

9.3 CRITICAL

📋 TL;DR

This vulnerability allows attackers to perform absolute path traversal attacks in the iedadata/usap-dc-website repository, enabling unauthorized file access. It affects users running versions through 1.0.1 of this GitHub repository's web application. The flaw exists due to unsafe usage of Flask's send_file function without proper path validation.

💻 Affected Systems

Products:
  • iedadata/usap-dc-website
Versions: through 1.0.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects deployments using the vulnerable Flask send_file implementation without additional security controls.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could read sensitive server files including configuration files, credentials, and system files, potentially leading to complete system compromise.

🟠

Likely Case

Unauthorized access to application files and potentially sensitive data stored on the server.

🟢

If Mitigated

Limited impact with proper file system permissions and network segmentation in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Path traversal vulnerabilities are well-understood and easily exploitable with basic HTTP requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after 1.0.1

Vendor Advisory: https://github.com/github/securitylab/issues/669#issuecomment-1117265726

Restart Required: Yes

Instructions:

1. Update to the latest version of iedadata/usap-dc-website repository. 2. Replace vulnerable send_file usage with secure implementation. 3. Restart the Flask application.

🔧 Temporary Workarounds

Implement Input Validation

all

Add server-side validation to sanitize file paths before passing to send_file function.

Restrict File System Access

all

Configure Flask application to run with minimal file system permissions.

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block path traversal patterns
  • Isolate the vulnerable application in a restricted network segment

🔍 How to Verify

Check if Vulnerable:

Review Flask application code for unsafe send_file usage without path validation.

Check Version:

Check repository version in deployment configuration or package metadata.

Verify Fix Applied:

Test that path traversal attempts (e.g., ../../../etc/passwd) are properly blocked.

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests containing ../ patterns
  • Failed file access attempts to system directories

Network Indicators:

  • HTTP requests with unusual path traversal sequences

SIEM Query:

source="web_server" AND (uri="*../*" OR uri="*..\\*")

🔗 References

📤 Share & Export