WordPress fixes XSS2Shell login-page flaw CVE-2026-64638 that can be chained to code execution

WordPress has patched a reflected cross-site scripting vulnerability on its login page that researchers showed can be escalated to server-side code execution. The flaw is tracked as CVE-2026-64638 (CVSS 8.9) and nicknamed XSS2Shell. It affects every standard WordPress installation, with no special plugin or hosting configuration required. Russian outlet Xakep.ru reported the issue on 13 August 2026.

Technical details

  • The bug was found by researchers at pwn.ai. An attacker supplies a specially crafted username to the login form. When the login fails, WordPress echoes the username in the error message and the injected script runs in the visitor’s browser. No authentication is needed to trigger it.
  • The root cause is a mismatch between parsers. A tag-like string with a space after < survives strip_tags(), but wp_kses_post() later treats it as valid HTML, which allows DOM elements to be injected into the error page.
  • To reach code execution, the researchers chained the XSS with WordPress’s own JavaScript, manipulation of the ajaxurl variable, the REST API and JSONP support, using the Same Origin Method Execution technique. From there, paths such as plugin installation or ZIP upload give arbitrary PHP execution.

Conditions and risk

The escalation to code execution requires that the victim is logged in as an administrator and interacts with an attacker-controlled page. In the demonstration a single click was enough. WordPress maintainers consider real-world RCE exploitation unlikely because it relies on social engineering. However, targeted phishing of site administrators is a well-established technique, and the XSS itself is trivial to trigger.

Fixed versions

The fix shipped in WordPress 7.0.3 on 6 August 2026. Backported security releases are available for older branches down to 4.7.

Recommendations

  • Confirm that automatic background updates are enabled, or update manually to 7.0.3 or the latest security release for your branch.
  • Administrators should avoid clicking unsolicited links while logged in to wp-admin, and should use a separate browser profile for site administration.
  • Use a web application firewall rule to block login requests with HTML-like usernames.
  • Limit the number of administrator accounts and require MFA for all of them.

Sources