File Inclusion
Basic Rules
- Keep system and services, including web application frameworks, updated with the latest version.
- Turn off PHP errors to avoid leaking the path of the application and other potentially revealing information.
- A Web Application Firewall (WAF) is a good option to help mitigate web application attacks.
-
Disable some PHP features that cause file inclusion vulnerabilities if your web app doesn't need them, such as
allow_url_fopenon andallow_url_include. - Carefully analyze the web application and allow only protocols and PHP wrappers that are in need.
- Never trust user input, and make sure to implement proper input validation against file inclusion.
- Implement whitelisting for file names and locations as well as blacklisting.
No comments to display
No comments to display