CVE-2024-53677

9.8 CRITICAL

📋 TL;DR

This vulnerability in Apache Struts allows attackers to manipulate file upload parameters to perform path traversal attacks, potentially leading to remote code execution. It affects Apache Struts versions 2.0.0 through 6.3.0. Applications using the legacy FileuploadInterceptor-based file upload logic are vulnerable.

💻 Affected Systems

Products:
  • Apache Struts
Versions: 2.0.0 through 6.3.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using legacy FileuploadInterceptor-based file upload logic. Applications using the new file upload mechanism are safe.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with full system compromise, allowing attackers to execute arbitrary commands, steal data, or deploy malware.

🟠

Likely Case

File upload manipulation leading to unauthorized file writes, potential web shell deployment, and limited code execution.

🟢

If Mitigated

Attack blocked at WAF/IPS layer or application properly validates/sanitizes file upload parameters.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires file upload functionality and path traversal manipulation. Public details available in S2-067 advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.4.0

Vendor Advisory: https://cwiki.apache.org/confluence/display/WW/S2-067

Restart Required: Yes

Instructions:

1. Upgrade Apache Struts to version 6.4.0 or later. 2. Migrate to the new file upload mechanism as described at https://struts.apache.org/core-developers/file-upload. 3. Restart application server.

🔧 Temporary Workarounds

Disable legacy file upload interceptor

all

Remove or disable FileuploadInterceptor from Struts configuration

Edit struts.xml to remove <interceptor-ref name="fileUpload"> references

Implement strict file upload validation

all

Add custom validation for file upload parameters including path traversal checks

Implement custom interceptor or validation logic to sanitize file upload parameters

🧯 If You Can't Patch

  • Implement WAF rules to block path traversal patterns in file upload requests
  • Restrict file upload functionality to authenticated users only and implement strict file type validation

🔍 How to Verify

Check if Vulnerable:

Check Struts version and verify if using FileuploadInterceptor. Review struts.xml for fileUpload interceptor references.

Check Version:

Check application dependencies or Maven/Gradle configuration for org.apache.struts:struts2-core version

Verify Fix Applied:

Confirm Struts version is 6.4.0+ and application uses new file upload mechanism. Test file upload functionality with path traversal attempts.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file upload requests with path traversal patterns (../, ..\, %2e%2e%2f)
  • File writes to unexpected directories
  • Web shell deployment attempts

Network Indicators:

  • HTTP POST requests with file upload parameters containing path traversal sequences
  • Unusual file extensions in upload requests

SIEM Query:

source="web_server" AND (http_method="POST" AND (uri_path="*upload*" OR uri_path="*file*")) AND (request_body="*../*" OR request_body="*..\\*" OR request_body="*%2e%2e%2f*")

🔗 References

📤 Share & Export