Miggo Logo

CVE-2024-53677:
Apache Struts file upload logic is flawed

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
12/11/2024
Updated
1/3/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:N/AU:Y/R:A/V:C/RE:L/U:Red
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.apache.struts:struts2-coremaven< 6.4.06.4.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the legacy FileUploadInterceptor and its associated multipart request handling. The advisory explicitly states that applications using FileUploadInterceptor are vulnerable, while the newer ActionFileUploadInterceptor (introduced in 6.4.0) is safe. The FileUploadInterceptor's intercept method is responsible for processing upload parameters, and the JakartaMultiPartRequest's parse method handles raw file upload data. Both fail to adequately sanitize user-supplied filenames, allowing path traversal. Confidence is high for FileUploadInterceptor due to direct advisory references, and medium for JakartaMultiPartRequest due to its role in the deprecated upload mechanism.

Vulnerable functions

org.apache.struts2.interceptor.FileUploadInterceptor.intercept
org/apache/struts2/interceptor/FileUploadInterceptor.java
The FileUploadInterceptor handles file upload parameters without properly sanitizing filenames, allowing attackers to inject path traversal sequences (e.g., '../') in filename parameters. This enables malicious files to be written to unintended locations, leading to potential RCE.
org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.parse
org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
This method processes multipart requests and constructs file paths using user-controlled filenames. Lack of proper validation against path traversal sequences in the filename parameter makes it vulnerable to directory traversal attacks.

WAF Protection Rules

WAF Rule

*il* uplo** lo*i* is *l*w** vuln*r**ility in *p**** Struts. *n *tt**k*r **n m*nipul*t* *il* uplo** p*r*ms to *n**l* p*t*s tr*v*rs*l *n* un**r som* *ir*umst*n**s t*is **n l*** to uplo**in* * m*li*ious *il* w*i** **n ** us** to p*r*orm R*mot* *o** *x**

Reasoning

T** vuln*r**ility st*ms *rom t** l****y *il*Uplo**Int*r**ptor *n* its *sso*i*t** multip*rt r*qu*st **n*lin*. T** **visory *xpli*itly st*t*s t**t *ppli**tions usin* *il*Uplo**Int*r**ptor *r* vuln*r**l*, w*il* t** n*w*r **tion*il*Uplo**Int*r**ptor (int