/

CVE-2026-17543

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in PHP Runtime Parameter Handling

CVE-2026-17543

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Query Manipulation and Data Exposure

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical SQL injection vulnerability in PHP results from improper escaping of backslashes in attacker-controlled parameters. When affected parameters are incorporated into database queries, an attacker may alter query behavior, access sensitive data, or perform unauthorized database actions.

Affected context

The issue may affect PHP applications that use vulnerable PHP 8.2, 8.3, 8.4, or 8.5 releases and pass attacker-provided parameters through escaping logic before constructing SQL queries. Risk is greatest where application code relies on escaping as its primary defense and database queries can be influenced through externally supplied input.

Exploit preconditions

  • Attack surface: Application endpoints, APIs, forms, or other interfaces that accept attacker-controlled parameters
  • Required access: The ability to submit input to a PHP application that performs database operations
  • Trigger point: Processing and escaping a supplied parameter before its inclusion in an SQL query
  • Why exploitation is possible: Improper backslash escaping can allow input to alter query syntax instead of remaining data

Why this happens

The vulnerability is caused by incorrect escaping of backslashes in attacker-controlled parameters. When escaping does not reliably preserve the boundary between data and SQL syntax, specially crafted input may be interpreted as part of a database command. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An attacker may bypass application query restrictions
  • Sensitive database records could be disclosed
  • Data may be modified, deleted, or corrupted
  • Authentication or authorization logic could be undermined
  • Database accounts or connected services may be abused
  • Availability could be affected through destructive or resource-intensive queries

General mitigation guidance

Mitigation generally focuses on ensuring that attacker-controlled values are never interpreted as SQL syntax.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all dynamic values
  • Avoiding string concatenation and manual escaping for SQL construction
  • Applying database-specific APIs that separate query structure from parameter data
  • Validating input according to expected type, length, and format as a secondary control
  • Using database accounts with the minimum required privileges
  • Centralizing database access patterns so unsafe query construction is less likely
  • Maintaining PHP and database components within supported, security-maintained release lines

How teams detect issues like this

Organizations commonly detect SQL injection risks through:

  • Static analysis rules identifying SQL string concatenation or interpolation
  • Code review checks for manual escaping used instead of parameter binding
  • Dynamic testing of parameters across authentication, search, filtering, and reporting paths
  • Database monitoring for anomalous query structures, errors, and access patterns
  • Policy enforcement requiring prepared statements in application data-access layers
  • Automated security testing and code review tools that flag injection-prone query construction

Sources

SourceLink
github.comgithub.com/php/php-src/security/advisories/GHSA-7qpv-r5mr-78m4

Frequently asked

questions

It may be remotely exploitable when a vulnerable PHP application exposes database-backed functionality that accepts attacker-controlled parameters.

Not necessarily. The required access depends on the affected application's endpoint protections; public interfaces may be reachable without authentication, while other paths may require a valid account.

Use parameterized queries or prepared statements so input values remain data and cannot change SQL query structure. Avoid relying on manual escaping as the primary defense.

Standardize safe database APIs, enforce least-privilege database accounts, review query construction during development, and use static and dynamic testing to identify injection-prone code.

Find out what's already
exploitable in your codebase.