Cyber Risks · PortSwigger Research

Lab: Web shell upload via extension blacklist bypass

Summary: PortSwigger's lab presents an image upload function that blacklists certain file extensions, but the blacklist can be bypassed because of a flaw in how it is configured. The exercise requires uploading a basic PHP web shell and a second file containing an Apache directive that maps an arbitrary extension (.l33t) to the executable MIME type application/x-httpd-php, then using the shell to exfiltrate the contents of /home/carlos/secret.

Bottom line: The bypass does not defeat the blacklist by finding a missing extension; it abuses the server's own mod_php configuration to make an arbitrary extension executable, so a control that only checks file names leaves the upload path open.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related