phpsafe 𝕏 GitHub
Official CA 421DTkQ3TSG3n7F9SkNZj9NxvdFGbypwkctPd2uupump This is the only official address.

File inclusion from user input

Severity: Critical CWE-98 OWASP A03:2021 Injection rule: include_user

Why it matters

Building include paths from input lets attackers load system files, uploaded images containing PHP or remote code. It is one of the fastest routes to a full server takeover.

βœ• Vulnerable
include $_GET['page'] . '.php';
βœ“ Secure
$pages = ['home' => 'home.php', 'about' => 'about.php'];
$page = $pages[$_GET['page'] ?? 'home'] ?? 'home.php';
include __DIR__ . '/pages/' . $page;

How to fix

Map allowed page names to fixed files with a whitelist array. Never build include paths from request data.

Scan my code

Paste a file and PHP Safe points to every line that matches this rule.

Scan my code β†’