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

XSS in PHP: what it is and how to prevent it

Cross-site scripting is still one of the most common web bugs. In PHP it usually comes down to printing data into HTML without escaping it for the place it lands.

Last updated

What it is

Reflected XSS echoes a value from the current request; stored XSS saves it, for example in a comment, and serves it to everyone; DOM-based XSS happens in client-side JavaScript. In each case the browser runs script with your site’s privileges, which can steal sessions or act as the user. MITRE classifies it as CWE-79.

How to detect it

How to fix it

Read-only checks and safe patterns

# Find raw echo of request data (read-only, rough first pass)
grep -rnE "echo\s+\$_(GET|POST|REQUEST|COOKIE)" --include=*.php . | grep -v /vendor/

// Escape on output, for the HTML context
echo htmlspecialchars($name, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8');

# Defense in depth: a Content-Security-Policy header (example)
Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'

Should I strip tags from input instead?

Filtering input helps, but escaping on output for the right context is what reliably prevents XSS. OWASP recommends output encoding first.

Does strip_tags() prevent XSS?

Not reliably. It does not handle attribute or JavaScript contexts and is easy to misuse. Use context-aware escaping.

Other PHP vulnerability classes

Sources

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

  1. CWE-79: Cross-site Scripting — MITRE CWE
  2. Cross Site Scripting Prevention Cheat Sheet — OWASP Cheat Sheet Series
  3. htmlspecialchars() — PHP Manual