/

CVE-2026-119426

Severity:

HIGH RISK

(7.5)

CSRF (CWE-352) in phpMyAdmin SQL Query Web Interfaces

CVE-2026-119426

Analyzed

Vulnerability type

Category:

Cross-Site Request Forgery

CWE:

CWE-352

Impact:

Unauthorized SQL execution and database modification

Severity:

HIGH RISK

(7.5)

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 cross-site request forgery vulnerability in phpMyAdmin allows an attacker to cause an authenticated user's browser to submit unauthorized SQL requests without a valid CSRF token. If a victim is logged in and can be induced to submit a crafted cross-site POST request, SQL may execute with that user's database privileges.

A cross-site request forgery vulnerability in phpMyAdmin allows an attacker to cause an authenticated user's browser to submit unauthorized SQL requests without a valid CSRF token. If a victim is logged in and can be induced to submit a crafted cross-site POST request, SQL may execute with that user's database privileges.

Affected context

The issue affects phpMyAdmin deployments through version 5.2.3 where non-AJAX POST requests to SQL execution endpoints do not consistently enforce CSRF token checks. Risk is greatest when users authenticate through HTTP or configuration-based authentication, remain logged in, and have database privileges that permit meaningful SQL operations.

The issue affects phpMyAdmin deployments through version 5.2.3 where non-AJAX POST requests to SQL execution endpoints do not consistently enforce CSRF token checks. Risk is greatest when users authenticate through HTTP or configuration-based authentication, remain logged in, and have database privileges that permit meaningful SQL operations.

Exploit preconditions

  • Attack surface: Web-based SQL request endpoints, including /sql and /database/sql
  • Required access: An authenticated phpMyAdmin session held by the victim
  • User interaction: The victim must be induced to submit or visit attacker-controlled content that causes a cross-site POST
  • Trigger point: Processing of a non-AJAX POST request carrying SQL-related parameters
  • Why exploitation is possible: The request may be accepted without a valid CSRF token, allowing the victim's authenticated browser session to authorize the operation
  • Attack surface: Web-based SQL request endpoints, including /sql and /database/sql
  • Required access: An authenticated phpMyAdmin session held by the victim
  • User interaction: The victim must be induced to submit or visit attacker-controlled content that causes a cross-site POST
  • Trigger point: Processing of a non-AJAX POST request carrying SQL-related parameters
  • Why exploitation is possible: The request may be accepted without a valid CSRF token, allowing the victim's authenticated browser session to authorize the operation

Why this happens

The vulnerability results from inconsistent CSRF enforcement for state-changing, non-AJAX POST requests. When a server relies on the victim's ambient authentication cookies but does not require a valid, session-bound anti-CSRF token or equivalent request-origin validation, an external site can cause the browser to send an authenticated request. This behavior maps to CWE-352: Cross-Site Request Forgery.

The vulnerability results from inconsistent CSRF enforcement for state-changing, non-AJAX POST requests. When a server relies on the victim's ambient authentication cookies but does not require a valid, session-bound anti-CSRF token or equivalent request-origin validation, an external site can cause the browser to send an authenticated request. This behavior maps to CWE-352: Cross-Site Request Forgery.

Potential impact

  • Unauthorized SQL statements may be executed with the victim's database privileges
  • Database records could be modified, deleted, or corrupted
  • Sensitive database contents may be exposed through attacker-induced operations
  • Application availability or data integrity could be affected
  • Higher-privileged database accounts could increase the severity of resulting damage
  • Unauthorized SQL statements may be executed with the victim's database privileges
  • Database records could be modified, deleted, or corrupted
  • Sensitive database contents may be exposed through attacker-induced operations
  • Application availability or data integrity could be affected
  • Higher-privileged database accounts could increase the severity of resulting damage

General mitigation guidance

Mitigation generally focuses on enforcing request authenticity for every state-changing operation.

Common defensive patterns include:

  • Require unpredictable, session-bound CSRF tokens on all relevant POST requests, including non-AJAX requests
  • Apply consistent server-side token validation before processing SQL-related actions
  • Use origin or referer checks as an additional control where appropriate
  • Configure cookies with secure, HttpOnly, and suitable SameSite attributes
  • Limit phpMyAdmin and database accounts to the minimum privileges required
  • Avoid exposing administrative interfaces broadly and require strong authentication
  • Separate high-privilege database operations from routine user sessions

Mitigation generally focuses on enforcing request authenticity for every state-changing operation.

Common defensive patterns include:

  • Require unpredictable, session-bound CSRF tokens on all relevant POST requests, including non-AJAX requests
  • Apply consistent server-side token validation before processing SQL-related actions
  • Use origin or referer checks as an additional control where appropriate
  • Configure cookies with secure, HttpOnly, and suitable SameSite attributes
  • Limit phpMyAdmin and database accounts to the minimum privileges required
  • Avoid exposing administrative interfaces broadly and require strong authentication
  • Separate high-privilege database operations from routine user sessions

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis and code review checks for state-changing routes that lack CSRF validation
  • Tests that submit cross-origin form requests to every administrative POST endpoint
  • Verification that token validation occurs before SQL parsing or execution
  • Web server and application logs showing unexpected SQL actions associated with otherwise normal user sessions
  • Policy enforcement requiring CSRF protection for all browser-authenticated state-changing requests
  • Automated security testing tools that assess CSRF coverage across authenticated workflows

Organizations can look for this weakness through:

  • Static analysis and code review checks for state-changing routes that lack CSRF validation
  • Tests that submit cross-origin form requests to every administrative POST endpoint
  • Verification that token validation occurs before SQL parsing or execution
  • Web server and application logs showing unexpected SQL actions associated with otherwise normal user sessions
  • Policy enforcement requiring CSRF protection for all browser-authenticated state-changing requests
  • Automated security testing tools that assess CSRF coverage across authenticated workflows

Sources

SourceLink
abraxaslabs.techabraxaslabs.tech/research/phpmyadmin-csrf-sql
github.comgithub.com/phpmyadmin/phpmyadmin
github.comgithub.com/phpmyadmin/phpmyadmin/blob/RELEASE_5_2_3/libraries/classes/Common.php#L87-L151
github.comgithub.com/phpmyadmin/phpmyadmin/commit/910322373f14ed4601c85234858f630f127569ef
github.comgithub.com/phpmyadmin/phpmyadmin/commit/d1e2b54b530685c24dd91181b9f64a5a64621789
github.comgithub.com/phpmyadmin/phpmyadmin/pull/20569
vulncheck.comvulncheck.com/advisories/phpmyadmin-through-5.2.3-csrf-token-bypass-via-non-ajax-post-to-sql

Frequently asked

questions

Yes, in the sense that an attacker can host or deliver external content that causes a victim's browser to send a request. Exploitation still depends on the victim having an active authenticated phpMyAdmin session and interacting with the attacker-controlled content.

Not necessarily. The victim's authenticated browser session supplies the relevant authentication context, although the resulting SQL activity is limited by the victim's database privileges.

Enforce robust, session-bound CSRF token validation on every state-changing request, including non-AJAX POST requests, and supplement it with appropriate origin and cookie protections.

Maintain a complete inventory of state-changing endpoints, test cross-origin request rejection in automated security tests, apply least privilege to database accounts, and require code review for any changes to authentication or request-validation logic.

Yes, in the sense that an attacker can host or deliver external content that causes a victim's browser to send a request. Exploitation still depends on the victim having an active authenticated phpMyAdmin session and interacting with the attacker-controlled content.

Not necessarily. The victim's authenticated browser session supplies the relevant authentication context, although the resulting SQL activity is limited by the victim's database privileges.

Enforce robust, session-bound CSRF token validation on every state-changing request, including non-AJAX POST requests, and supplement it with appropriate origin and cookie protections.

Maintain a complete inventory of state-changing endpoints, test cross-origin request rejection in automated security tests, apply least privilege to database accounts, and require code review for any changes to authentication or request-validation logic.

Find out what's already
exploitable in your codebase.