CVE-2025-7906

6.3 MEDIUM

📋 TL;DR

This critical vulnerability in RuoYi allows attackers to upload arbitrary files without restrictions via the uploadFile function. Remote attackers can exploit this to upload malicious files like web shells, potentially gaining full control of affected systems. All users of RuoYi up to version 4.8.1 are affected.

💻 Affected Systems

Products:
  • yangzongzhuan RuoYi
Versions: up to and including 4.8.1
Operating Systems: Any OS running RuoYi (typically Linux/Windows with Java)
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using the vulnerable CommonController.java file are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, and lateral movement within the network.

🟠

Likely Case

Attackers upload web shells to gain persistent access, execute arbitrary commands, and potentially pivot to other systems.

🟢

If Mitigated

With proper file upload validation and web application firewalls, exploitation attempts are blocked and logged.

🌐 Internet-Facing: HIGH - Remote exploitation without authentication makes internet-facing instances extremely vulnerable.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could still exploit this vulnerability.

🎯 Exploit Status

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

Exploit details are publicly disclosed on GitHub, making this easily exploitable by attackers with basic skills.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.8.2 or later

Vendor Advisory: https://github.com/yangzongzhuan/RuoYi/issues/296

Restart Required: Yes

Instructions:

1. Update RuoYi to version 4.8.2 or later. 2. Replace the vulnerable CommonController.java file. 3. Restart the RuoYi application server.

🔧 Temporary Workarounds

File Upload Restriction

all

Implement server-side file type validation and restrict uploads to specific directories with proper permissions.

WAF Rule Implementation

all

Deploy web application firewall rules to block file uploads with dangerous extensions or suspicious patterns.

🧯 If You Can't Patch

  • Isolate the RuoYi instance from the internet and restrict network access to only necessary systems.
  • Implement strict file upload validation in application code and monitor upload directories for suspicious files.

🔍 How to Verify

Check if Vulnerable:

Check RuoYi version in application properties or by examining the CommonController.java file for missing file upload validation.

Check Version:

Check ruoyi-admin/pom.xml for version tag or application.properties for ruoyi.version

Verify Fix Applied:

Verify RuoYi version is 4.8.2+ and test file upload functionality with malicious files to ensure they are rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file uploads to /common/upload endpoint
  • Files with suspicious extensions (.jsp, .php, .war) in upload directories
  • Multiple failed upload attempts

Network Indicators:

  • POST requests to /common/upload with unusual file types
  • Subsequent connections to uploaded files from external IPs

SIEM Query:

source="ruoyi-logs" AND (uri="/common/upload" OR file_extension IN ("jsp", "php", "war"))

🔗 References

📤 Share & Export