Any reasonably configured server will not execute .jpg
files as PHP when accessed directly*.
This includes default configurations for common servers like Apache or nginx. A server would need to be specifically configured to parse non-PHP file extensions as PHP. From your description, this isn't the case here (the file is correctly handled as image file).
I'm not saying that the application isn't vulnerable, but allowing .php.jpg
files to be uploaded is a valid practice. To bypass a file upload restriction, you'd want your file to for example end in .php
(or related extensions which will be executed as PHP).
* they will be executed regardless of extension if they are for example included via include
, but in that case it doesn't matter if the file ends in .php.jpg
or just .jpg
- or if the content (type) is validated for that matter.