Ehxb File Upload Vulnerabilities I
The application allowed uploading PHP files that the server executed, and in later scenarios the server only checked the client-supplied Content-Type header or used a bypassable path traversal filter. An attacker could upload a web shell and run arbitrary commands on the server, including reading sensitive files.
When a Simple Avatar Upload Became a Server Takeover: File Upload Vulnerabilities Explained
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
The server failed to validate uploaded files properly, relying on client-controlled headers or flawed filters instead of checking file contents and enforcing safe storage.
Impact
An attacker could execute arbitrary commands on the server, read sensitive files, and potentially take full control of the server.
What the attacker needed
A user account; ability to upload files
The fix
The application should validate file contents, not just client-supplied headers, and store uploads outside the web root or in a non-executable directory.
How it was found
- Log in and go to the avatar upload form.
- Create a PHP file that executes a command from a URL parameter.
- Upload the PHP file; the server accepts it.
- Find the uploaded file's URL from the page source or network tab.
- Access the file with a command parameter to execute commands and read a secret file.
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 files properly, someone can upload a script that the server runs, giving them control. This is like letting a stranger put a program on your computer and then running it.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.