Definition

Local file inclusion is a security vulnerability that enables attackers to access or execute files stored on the web server. It can allow hackers to access systems, view confidential information, and execute malicious code.

The Open Source Foundation for Application Security (OWASP) considers LFI a dangerous threat and features it among the top 10 web application vulnerabilities.

How Local File Inclusion Works

Local file inclusion happens when an application fails to adequately validate or sanitize user input that determines which file to include. The attacker injects malicious input, often as a file path or directory traversal sequence, to manipulate the application into including sensitive files or executing harmful code.

Local File Inclusion Techniques

Stopping Local File Inclusion Attacks