Menu

1 / 2

Security Tip: Local and Remote File Inclusion, Explained Simply

DEV Community: cybersecurity·Vulnerability Tools·about 16 hours ago
#DGfvT2bK
#devtocybersecurity#devto#dev#files#file
Reading 0:00
15s threshold

Websites built with server-side code (PHP especially) often include files based on user input — a language parameter, a page name, a theme choice. When that input isn't checked, attackers can reach files they should never touch. That is a file inclusion vulnerability, and it comes in two flavors: Local File Inclusion (LFI) and Remote File Inclusion (RFI).

With LFI, an attacker tricks the site into reading files already on the server — configuration files, credentials, or sensitive system files on a misconfigured host. The request might hide something like page=../../../../etc/passwd inside an otherwise normal-looking URL.

With RFI, the attacker goes further: they point the include at a malicious file hosted on their own server, and the website downloads and executes it. That is a direct path to full server takeover.

Why should this matter to you? File inclusion is not a theoretical bug.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.