CVE-2025-58755

8.8 HIGH

📋 TL;DR

This vulnerability in MONAI allows path traversal attacks through malicious ZIP files. When MONAI processes compressed files using extractall(), attackers can overwrite arbitrary system files. This affects all MONAI users who process ZIP files from untrusted sources.

💻 Affected Systems

Products:
  • MONAI (Medical Open Network for AI)
Versions: All versions up to and including 1.5.0
Operating Systems: All platforms where MONAI runs (Linux, Windows, macOS)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists wherever extractall() is used with untrusted ZIP files. Medical imaging workflows often involve processing external data, increasing exposure.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through overwriting critical system files, potentially leading to remote code execution and data destruction.

🟠

Likely Case

Local file overwrite leading to data corruption, denial of service, or privilege escalation depending on file locations.

🟢

If Mitigated

Limited to application directory damage if proper sandboxing and file permission controls are implemented.

🌐 Internet-Facing: HIGH - The advisory mentions download through links increases exploitation scope, making internet-facing instances particularly vulnerable.
🏢 Internal Only: MEDIUM - Internal systems processing medical imaging data from untrusted sources remain at risk.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW - Creating malicious ZIP files with path traversal payloads is straightforward.

No known exploits in the wild at publication time, but exploitation is trivial for attackers with ZIP file creation capabilities.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: None available as of publication

Vendor Advisory: https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-x6ww-pf9m-m73m

Restart Required: No

Instructions:

No official patch available. Monitor MONAI GitHub repository for security updates and patch immediately when released.

🔧 Temporary Workarounds

Implement ZIP file validation

all

Validate ZIP file contents before extraction to ensure no path traversal attempts.

# Python example to check for path traversal
import zipfile
with zipfile.ZipFile('file.zip') as zf:
    for name in zf.namelist():
        if '..' in name or name.startswith('/'):
            raise ValueError('Path traversal detected')

Use safe extraction directory

all

Extract to a temporary, isolated directory with restricted permissions.

# Python example using temp directory
import tempfile
import zipfile
import os
with tempfile.TemporaryDirectory() as tmpdir:
    with zipfile.ZipFile('file.zip') as zf:
        zf.extractall(tmpdir)
    # Process files from tmpdir only

🧯 If You Can't Patch

  • Disable ZIP file processing from untrusted sources entirely
  • Implement strict file permission controls and run MONAI with minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check MONAI version with: python -c "import monai; print(monai.__version__)" and verify if ≤1.5.0

Check Version:

python -c "import monai; print(monai.__version__)"

Verify Fix Applied:

When patch is available, update MONAI and test with malicious ZIP files containing path traversal payloads

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file overwrites in system directories
  • MONAI process accessing files outside expected directories
  • Errors from failed path traversal attempts

Network Indicators:

  • Downloads of ZIP files followed by file system changes outside application directory

SIEM Query:

Process:monai AND (FileCreate:*\\..\\* OR FileCreate:*\\..\\..\\*)

🔗 References

📤 Share & Export