Consider a team whose dependency scanner reports an Apache Struts version with the fix for CVE-2024-53677. They close the ticket. But their application still uses the old FileUploadInterceptor. Apache's security bulletin says that upgrading alone does not resolve this case: the application must migrate its upload actions to ActionFileUploadInterceptor. That is the story behind this post. A version check is useful; it is not a test of the running upload workflow.
Apache announced S2-067 on 10 December 2024. It describes an attacker manipulating upload parameters to enable path traversal. Under some circumstances, that can place a malicious file where it can lead to remote code execution. The condition matters: this is not a claim that every Struts upload is exploitable, or that any arbitrary file automatically executes. Apache explicitly says applications not using the old FileUploadInterceptor are safe from this issue.
- CVE
- CVE-2024-53677 (Apache Struts bulletin S2-067)
- Product
- Struts 2.0.0–2.3.37 and 2.5.0–2.5.33 (both end-of-life), and 6.0.0–6.3.0.2, when the old FileUploadInterceptor is used.
- Class
- Unrestricted file upload (CWE-434); upload-parameter path traversal.
- Severity
- NVD CVSS 3.1: 9.8 (Critical). Apache's bulletin rates the maximum impact Critical.
- Published
- 10 December 2024 (Apache announcement).
- Fix
- Upgrade to Struts 6.4.0 or later and migrate upload actions to ActionFileUploadInterceptor. This change is not backward compatible.
The root cause, in one sentence
Upload metadata supplied by a client was allowed to influence where an uploaded file could land, across a boundary that should have been set by the server.
An upload is not one operation. The browser sends bytes, a filename and form fields; a framework parses them; the application may rename, scan, transform, store and serve the result. At each stage a value originating with the client can quietly become a path, a file type or a URL. S2-067 is a specific flaw in one Struts upload mechanism, not a universal Struts weakness. The general failure mode—trusting upload metadata across those boundaries—appears in many stacks.
We are not publishing an exploit request. For Struts, start with Apache's S2-067 bulletin and its Action File Upload migration guidance. We describe the test strategy without giving a file-placement payload.
The five shapes unsafe uploads take
1. A client-controlled path becomes a storage path
The application trusts a filename, multipart parameter or folder hint as a destination instead of choosing a server-side location. Normalising the path only in one layer is insufficient if another layer later interprets separators or encoded characters differently. The stored location, not the echoed filename, is the evidence that matters.
2. The framework was upgraded, the old handler stayed
This is S2-067's distinctive trap. Apache says the old interceptor remains vulnerable even after a move to Struts 6.4.0 if the actions are not rewritten. Look for actual interceptor configuration and action code, not only the version in a dependency manifest. A regression test should exercise the migrated action, not merely confirm the build succeeds.
3. Validation trusts an extension or content type
A browser supplies both. A file can be renamed to pass a suffix check, or labelled with a different MIME type. Treat those values as hints; validate against what the application expects, apply allowlists and inspect content before publishing it. File-format complexity means a single superficial magic-byte check is not a guarantee of safety.
4. A safe upload becomes unsafe when served
A file stored outside the application can still be exposed through a download endpoint. If it is served with an executable content type or on the application origin, a user's browser may process attacker-controlled content in the site's security context. Storage, retrieval and response headers belong in the same test case.
5. An internal import path bypasses the public rules
Admin tools, API endpoints, batch imports and third-party connectors often accept the same files through different handlers. Fixing one web form does not fix every route. The test inventory should include who can upload, which handler receives it and where each route ultimately stores the file.
A clean version scan is not a clean upload test. For S2-067, Apache explicitly requires a code migration. A scanner that reads only the Struts version cannot establish that the old upload interceptor is gone. Review the deployed interceptor stack and exercise the upload workflow in a controlled environment.
How we test for it
- Map every upload entry point. Identify browser forms, API routes, imports and admin-only paths; record authentication and authorisation for each.
- Identify the receiving handler. For Struts, inspect whether the deployed application uses
FileUploadInterceptoror the newActionFileUploadInterceptor. Confirm the running version and migrated action code. - Set a harmless baseline. Upload an agreed inert test file, then observe its stored name, location, permissions, download URL and response headers. Never use executable content as a first probe.
- Vary one trust boundary at a time. Test how the handler treats a changed filename, declared media type and destination hint, using only benign data and the rules of engagement. Compare the actual stored result with the server's intended path.
- Check retrieval and isolation. Confirm uploads are stored outside executable locations and served as downloads where appropriate, with access controls and a separate origin when untrusted content requires browser isolation.
- Report the exact fix. The outcome should say which route, interceptor and storage rule failed, with evidence of the stored result and a regression test. For S2-067, upgrading without migrating is not the remedy.
The evidence and the corrective action belong together. Our reporting approach shows how we make a finding reproducible without publishing dangerous material.
Six things to check in your application this week
- Inventory every upload route and the code path it reaches, including admin imports and APIs.
- If you use Struts, check the deployed interceptor and action implementation; follow Apache's S2-067 migration guidance, not just a dependency-version ticket.
- Generate destination paths and stored filenames on the server; do not trust a client-provided path or name.
- Allow only the file types the workflow needs, validate content and impose size limits.
- Keep uploads out of executable directories and review how downloads set content type, disposition and access controls.
- Add a regression test for the actual upload and retrieval path after each framework change.
File upload flaws are rarely solved by one filter. We test the full route from request to stored file to browser response—and check whether the fix changed the deployed behaviour.
References
- Apache Struts — S2-067 security bulletin
- Apache Struts — Action File Upload documentation
- NVD — CVE-2024-53677 detail
- OWASP — File Upload Cheat Sheet