Not php.net · Not NVD · Not CISA

PHP Vulnerability Tracker

Unofficial briefing on PHP security vulnerabilities

English简体中文日本語DeutschFrançaisNederlandsEspañol

Security alert

PHP2Shell: upgrade PHP. That is the only complete fix.

CVE-2026-109618 and CVE-2026-109619 are critical, unauthenticated remote-code-execution bugs in PHP itself. The PHP project shipped fixes on 21 October 2026 for the supported 8.2–8.5 branches. Restart PHP after you upgrade. A firewall is not a substitute.

Remediation steps

PHP security explainer · defensive

PHP file inclusion (LFI/RFI): what it is and how to fix it

include and require execute whatever file they are given. When part of that path comes from the request, the visitor decides what runs.

Last updated

What it is

Local file inclusion (LFI) lets a request point include or require at files already on the server, such as configuration files or logs; combined with an upload or log entry it can become code execution. Remote file inclusion (RFI) loads code from another server and only works when allow_url_include is enabled, which php.net documents as off by default. MITRE classifies it as CWE-98.

How to detect it

How to fix it

Read-only checks and safe patterns

# Find include/require with a variable path (read-only)
grep -rnE "(include|require)(_once)?\s*\(?\s*\$" --include=*.php . | grep -v /vendor/
php -i | grep -E "allow_url_include|allow_url_fopen|open_basedir"

; php.ini hardening
allow_url_include = Off
open_basedir = /var/www/example:/tmp

// Map user choices to fixed files instead of building paths
$pages = ['home' => 'home.php', 'about' => 'about.php'];
require __DIR__ . '/pages/' . ($pages[$_GET['p'] ?? 'home'] ?? 'home.php');

Does basename() make an include safe?

It removes directory parts but still lets a visitor pick any file in that directory. An explicit allowlist is safer.

Is RFI still a risk in modern PHP?

Only if allow_url_include has been turned on. LFI remains common because it needs no special setting.

Other PHP vulnerability classes

Sources

Outbound links leave this site. We do not host exploit code.

  1. CWE-98: PHP Remote File Inclusion — MITRE CWE
  2. Testing for Local File Inclusion — OWASP Web Security Testing Guide
  3. Filesystem runtime configuration (allow_url_fopen, allow_url_include) — PHP Manual
  4. Core php.ini directives (open_basedir, expose_php) — PHP Manual