CVE-2024-53924

9.8 CRITICAL

📋 TL;DR

Pycel versions up to 1.0b30 allow remote code execution when processing untrusted Excel spreadsheets containing malicious formulas. Attackers can craft formulas that execute arbitrary Python code on the server. This affects any application using Pycel to parse user-uploaded spreadsheets.

💻 Affected Systems

Products:
  • Pycel
Versions: All versions through 1.0b30
Operating Systems: All platforms running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only vulnerable when processing untrusted spreadsheets with formulas.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise allowing attacker to execute arbitrary commands, install malware, steal data, or pivot to other systems.

🟠

Likely Case

Remote code execution leading to data theft, system manipulation, or deployment of ransomware.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing prevent formula execution.

🌐 Internet-Facing: HIGH - Spreadsheets can be uploaded via web interfaces without authentication.
🏢 Internal Only: MEDIUM - Requires user interaction with malicious spreadsheets internally.

🎯 Exploit Status

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

Proof-of-concept available in GitHub gist showing formula injection.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Consider workarounds or alternative libraries.

🔧 Temporary Workarounds

Disable formula evaluation

all

Configure Pycel to not evaluate formulas in untrusted spreadsheets

Set formula_evaluation=False when initializing Pycel

Input sanitization

all

Strip or block formulas from user-uploaded spreadsheets before processing

Implement pre-processing to remove cells starting with '='

🧯 If You Can't Patch

  • Isolate Pycel processing in sandboxed containers with minimal privileges
  • Implement strict file upload validation rejecting spreadsheets with formulas

🔍 How to Verify

Check if Vulnerable:

Check Pycel version with pip show pycel or examine requirements.txt for version <=1.0b30

Check Version:

pip show pycel | grep Version

Verify Fix Applied:

Test with malicious spreadsheet containing =IF(A1=200, eval("__import__('os').system('id')")) formula

📡 Detection & Monitoring

Log Indicators:

  • Python eval() or exec() calls in Pycel logs
  • Unexpected system commands from Python process

Network Indicators:

  • Outbound connections from Pycel process to unexpected destinations

SIEM Query:

process:pycel AND (command:eval OR command:exec OR command:system)

🔗 References

📤 Share & Export