CVE-2022-31581

9.3 CRITICAL

📋 TL;DR

This vulnerability allows attackers to read arbitrary files on the server through absolute path traversal in the OpenMF application. It affects any deployment of OpenMF before May 3, 2022 that uses the vulnerable Flask send_file implementation. Attackers can access sensitive system files including configuration files, credentials, and other protected data.

💻 Affected Systems

Products:
  • scorelab/OpenMF
Versions: All versions before 2022-05-03
Operating Systems: All operating systems running OpenMF
Default Config Vulnerable: ⚠️ Yes
Notes: Any deployment using the vulnerable Flask send_file implementation is affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise through reading sensitive files like /etc/passwd, SSH keys, database credentials, or application secrets leading to lateral movement and data exfiltration.

🟠

Likely Case

Unauthorized access to sensitive application files, configuration data, and potentially user data stored on the server filesystem.

🟢

If Mitigated

Limited impact with proper file permissions and network segmentation, but still potential for information disclosure about server configuration.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability is simple to exploit by manipulating file paths in requests to the vulnerable endpoint.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in repository after 2022-05-03

Vendor Advisory: https://github.com/scorelab/OpenMF/issues/262

Restart Required: Yes

Instructions:

1. Update to the latest OpenMF version from GitHub repository after May 3, 2022. 2. Replace the vulnerable Flask send_file usage with secure implementation. 3. Restart the OpenMF application service.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

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

Web Application Firewall Rules

all

Configure WAF to block requests containing path traversal patterns and absolute path references

🧯 If You Can't Patch

  • Implement strict file system permissions to limit what files the application user can access
  • Deploy network segmentation to isolate OpenMF from sensitive systems and limit lateral movement potential

🔍 How to Verify

Check if Vulnerable:

Check if your OpenMF deployment uses code from before May 3, 2022 and examine Flask send_file usage for path traversal vulnerabilities

Check Version:

Check git commit history or repository version to confirm it's after 2022-05-03

Verify Fix Applied:

Verify that absolute path traversal attempts are properly rejected and only allowed files can be accessed

📡 Detection & Monitoring

Log Indicators:

  • Requests containing absolute paths like /etc/passwd, ../ sequences, or unusual file access patterns

Network Indicators:

  • Unusual file access patterns from single IP addresses, repeated failed attempts to access system files

SIEM Query:

source="openmf" AND (url="*../*" OR url="*/etc/*" OR url="*/root/*" OR url="*/windows/*")

🔗 References

📤 Share & Export