How I Found Multiple Critical Vulnerabilities in File Upload Func
The application accepted SVG files containing scripts and external references without validation, allowing stored XSS, open redirection, and SSRF. It also failed to sanitise filenames, strip Exif metadata, enforce file size limits, and prevent race conditions, enabling further attacks.
Let me introduce myself! 😊 I’m Suresh 👋, a penetration tester🕵️♂️ and ethical hacker💀 with a passion for securing web applications. Over time, I have reported multiple security vulnerabilities across various platforms and have earned several bug bounty rewards, Hall of Fame mentions, and swag for my findings.
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 application did not validate or sanitise uploaded file contents, names, and metadata, and did not restrict file size or concurrent uploads.
Impact
An attacker could execute scripts in users' browsers, redirect users to malicious sites, make the server request internal resources, leak sensitive metadata, cause denial of service, bypass upload restrictions to achieve remote code execution, and exploit race conditions.
What the attacker needed
File upload functionality; ability to upload SVG or other files; victim views uploaded file
The fix
The application should strictly validate file types and contents, sanitise filenames, strip metadata, enforce size limits, disable script execution in upload directories, use randomised names, and implement concurrency controls.
How it was found
- Locate the file upload functionality.
- Create an SVG file containing a script.
- Upload the SVG file.
- Access the uploaded file directly in a browser.
- Observe the script executing.
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 lets users send files to a website. If the site does not check what is inside the file, an attacker can upload a file that contains a script or a link to another server. When someone views that file, the script runs in their browser or the server fetches the link, which can steal data or redirect the user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.