CVE-2022-31545

9.3 CRITICAL

📋 TL;DR

This vulnerability allows attackers to read arbitrary files on the server through absolute path traversal in the ml-inory/ModelConverter repository. It affects any system running this software with the vulnerable Flask send_file implementation. The high CVSS score reflects the potential for sensitive data exposure.

💻 Affected Systems

Products:
  • ml-inory/ModelConverter
Versions: All versions through 2021-04-26
Operating Systems: All operating systems running Python/Flask
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments using the vulnerable Flask send_file implementation in the repository.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise through reading sensitive files like /etc/passwd, SSH keys, or configuration files containing credentials, potentially leading to lateral movement.

🟠

Likely Case

Unauthorized access to sensitive files on the server, including source code, configuration files, and potentially user data.

🟢

If Mitigated

Limited impact with proper file system permissions and network segmentation preventing access to critical system files.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability is well-documented in GitHub security advisories with proof-of-concept details available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after 2021-04-26

Vendor Advisory: https://github.com/github/securitylab/issues/669

Restart Required: Yes

Instructions:

1. Update to the latest version of ml-inory/ModelConverter repository. 2. Replace vulnerable Flask send_file calls with secure implementations. 3. Restart the application service.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation to reject absolute paths and directory traversal sequences

Web Application Firewall Rules

all

Configure WAF to block requests containing path traversal patterns like '../' or absolute paths

🧯 If You Can't Patch

  • Implement strict file system permissions to limit application access to only necessary directories
  • Deploy network segmentation to isolate vulnerable systems from sensitive data stores

🔍 How to Verify

Check if Vulnerable:

Review Flask send_file usage in the application code for unsafe path handling without validation

Check Version:

Check repository commit history or version metadata to confirm it's newer than 2021-04-26

Verify Fix Applied:

Test that absolute path traversal attempts are properly rejected and return appropriate error responses

📡 Detection & Monitoring

Log Indicators:

  • HTTP requests containing absolute paths or directory traversal sequences
  • Unusual file access patterns from web application user

Network Indicators:

  • HTTP requests with suspicious path parameters attempting to access system files

SIEM Query:

web_access_logs WHERE url CONTAINS '/etc/' OR url CONTAINS '../' OR url CONTAINS 'C:\'

🔗 References

📤 Share & Export