Description
Misconfigurations in Nginx, particularly with PHP FPM (FastCGI Process Manager), can lead to a critical security vulnerability. Attackers can exploit this misconfiguration by appending /.php to the end of any file URL, allowing them to execute arbitrary PHP code on the server.
Recommendation
To mitigate this risk, modify your PHP FPM configurations in Nginx as follows:
location ~ [^/]\.php$ {
...
}
Ensure that the location directive includes [^/] before \.php to restrict access and prevent unauthorized execution of PHP scripts.
References
Could your website be exposed too?
SmartScanner can check your website for Nginx Code Execution due to Misconfiguration and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Nginx Null Byte Code Execution - CVE-2013-2028
- dom-iterator code execution vulnerability - CVE-2024-21541
- Flowise: CSV Agent Prompt Injection Remote Code Execution Vulnerability - flowise-components - CVE-2026-70477
- Flowise: Remote Code Execution Vulnerability in CSVAgent - CVE-2026-69256


