Remote file inclusion (RFI) is a vulnerability in web applications that lets an attacker make the application load and execute a file hosted on an external server. It arises when code builds the path of a file to include from user input, such as a parameter in a URL, without checking it, and when the language or server allows remote files to be included, as some PHP configurations once did by default. The attacker supplies the address of a malicious script, which then runs with the website's permissions.
A successful RFI can lead to full control of the server, theft of customer data or payment details, defacement or the installation of malware. Defences include validating input against an allowlist of permitted files, disabling remote inclusion in server settings, keeping software patched and placing a web application firewall (WAF) in front of the site. A related flaw, local file inclusion, loads files already on the server. Both are part of ordinary cybersecurity testing.
Ref 1140000188