PHP Execution in Upload Directories Check
Checks whether a file that reached an upload directory would be executed as PHP, without uploading anything.
What This Check Detects
Checks whether a file that reached an upload directory would be executed as PHP, without uploading anything.
Full Documentation
What this check looks for
StackShield asks your server for PHP files that do not exist, under the paths where uploads usually live: /storage, /uploads, /media and similar. Nothing is uploaded. A server that treats those paths as static files answers with its own 404 page. A server that hands the request to PHP-FPM answers with PHP-FPM's File not found., which shows that a real .php file at that path would be executed.
The check then repeats the request with the other extensions PHP can be mapped to (.phtml, .phar, .php5, .pht), and tests whether appending /x.php to a static file makes the server run that file as PHP.
Why it matters
Upload validation fails in many small ways: a missed extension, a trusted MIME type, a double extension. Whether such a mistake is a nuisance or a full server compromise depends on one thing, which is whether the web server will execute what was uploaded. Many common nginx configurations pass every .php path to PHP rather than only the front controller.
What the findings mean
A high finding means static files can be run as PHP by appending /x.php, so an image with PHP code inside it is enough for remote code execution. A medium finding means extensions other than .php are executed, which name-based upload filters usually miss. A warning means .php files under upload paths would run. That needs an upload flaw to exploit, and removing it costs one line of configuration.
In nginx, pass only the front controller to PHP with location ~ ^/index\.php(/|$). Set security.limit_extensions = .php in the PHP-FPM pool and cgi.fix_pathinfo=0 in php.ini. Servers that run PHP through Apache's mod_php cannot be assessed this way and are reported as passing.
Related Security Checks
Sensitive Laravel Files
Checks for exposed sensitive Laravel files (.git, logs, config).
File Upload Security
Tests file upload endpoints for security vulnerabilities.
Exposed Diagnostic Pages and Database Tools
Looks for phpinfo pages, PHP-FPM and web server status pages, Adminer, phpMyAdmin and OPcache panels left reachable.
Is your Laravel app exposed right now?
34% of Laravel apps we scan have at least one critical issue, and most teams do not find out until something breaks. The free scan checks your live app in 60 seconds. Then StackShield re-runs every check after each deploy, so a fix you ship today does not quietly regress next week.