How I Bypassed Enterprise File Restrictions with Just One Character
The file upload filter used a blocklist that checked filenames before sanitising them, so a filename containing a percent sign confused the check and allowed a restricted .exe file to be uploaded. An unauthenticated user could upload banned file types to the public customer portal.
Published on medium.com
We often imagine enterprise security as a high-tech fortress, guarded by complex algorithms and AI. But sometimes, the biggest gates are opened by the smallest keys.
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 filename was checked against the blocklist before it was sanitised, so the validator saw a different string than the one that was saved.
Impact
An unauthenticated user could upload restricted file types to the public customer portal, bypassing the primary security control, though the server renamed the extension which may limit direct execution.
What the attacker needed
Access to the public customer portal; ability to intercept HTTP requests
The fix
The order of operations should be corrected so the filename is sanitised before it is checked against the blocklist.
How it was found
- Create a harmless dummy file named sample.pdf.
- Intercept the upload request and change the filename to include percent signs around the .exe extension.
- Send the request and observe a 200 OK response.
- Check the ticket attachment and see the file was uploaded with the extension renamed to underscores.
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 filter is supposed to stop dangerous files like .exe programs. Here the filter checked the name first and cleaned it afterwards, so a strange character in the name slipped past the check. That let someone upload a file the system said it would block.
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.