The Art of Intrusion: File Upload Bypass & WAF XSS Evasion in AWS S3 Demystified
A file upload feature accepted a double extension, allowing an HTML file to be stored in an AWS S3 bucket, and a cross-site scripting payload was then executed when the file was viewed. A WAF blocked common XSS payloads, but using the print() function instead of alert() bypassed the filter.
Published on laburity.com
Greetings, today we will be sharing an XSS WAF bypass vulnerability that was identified by one of your Application Penetration Testers while working for a client’s audit. Due to the privacy concerns let’s call the target redacted.com.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the file upload validation only checked the final extension or used a blacklist that could be bypassed with a double extension, and the XSS filter relied on blocking specific JavaScript functions like alert().
Impact
An attacker could upload a malicious HTML file that executes JavaScript when viewed, potentially leading to code execution or data leakage, though a WAF blocked some payloads and only print() worked.
What the attacker needed
Ability to upload files; victim opens the uploaded file
The fix
The file upload should validate file content and use a whitelist of allowed extensions, and the XSS filter should not rely on blocking specific JavaScript functions.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A file upload feature let users upload files but only checked the file extension. By naming a file with two extensions, the tester tricked the system into accepting an HTML file that could run JavaScript. When that file was opened, the script ran, which is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.