CVE-2024-12390

8.8 HIGH

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code on systems running vulnerable versions of binary-husky/gpt_academic. Attackers can exploit improper RAR file validation to write malicious files to sensitive locations like SSH keys or application code. Anyone using the affected version is at risk.

💻 Affected Systems

Products:
  • binary-husky/gpt_academic
Versions: git commit 310122f and earlier versions with the vulnerable code
Operating Systems: All platforms running Python with rarfile module
Default Config Vulnerable: ⚠️ Yes
Notes: Any installation using the default configuration that processes user-provided RAR files is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise through remote code execution, allowing attackers to steal data, install malware, or pivot to other systems.

🟠

Likely Case

Application compromise leading to data theft, unauthorized access, or service disruption.

🟢

If Mitigated

Limited impact with proper file system permissions and network segmentation preventing lateral movement.

🌐 Internet-Facing: HIGH - The vulnerability can be exploited remotely without authentication.
🏢 Internal Only: MEDIUM - Internal attackers could exploit this, but external exposure increases risk significantly.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires crafting malicious RAR files with symlinks, but no public exploit code is currently available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Versions after git commit 310122f

Vendor Advisory: https://huntr.com/bounties/1add2b26-460d-4aa5-8fda-ab045d153177

Restart Required: No

Instructions:

1. Update to the latest version of gpt_academic. 2. Verify the fix by checking that RAR file extraction now validates symlinks. 3. No restart required as it's a Python application.

🔧 Temporary Workarounds

Disable RAR file processing

all

Temporarily disable RAR file extraction functionality until patched

Modify application configuration to reject RAR files or disable extraction features

Implement file validation

all

Add validation to reject RAR files containing symlinks before extraction

Implement pre-extraction validation in Python code to scan for symlinks

🧯 If You Can't Patch

  • Implement strict file system permissions to limit write access to sensitive directories
  • Deploy network segmentation to isolate the application from critical systems

🔍 How to Verify

Check if Vulnerable:

Check if your gpt_academic installation uses git commit 310122f or earlier by examining the version or commit hash

Check Version:

git log --oneline -1

Verify Fix Applied:

Verify the application now validates symlinks in RAR files before extraction

📡 Detection & Monitoring

Log Indicators:

  • Unusual RAR file processing activity
  • File write operations to sensitive locations like /etc/, /root/, or SSH directories

Network Indicators:

  • Unexpected outbound connections from the application server

SIEM Query:

source="application.logs" AND "rar" AND "extract" AND ("symlink" OR "../")

🔗 References

📤 Share & Export