Skip to main content
Vulnerability Database/CVE-2026-97637

CVE-2026-97637: WordPress JSON API Auth Bypass Vulnerability

CVE-2026-97637 is an authentication bypass flaw in WordPress JSON API Auth plugin that allows attackers to steal admin session cookies via cached responses. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-97637 Overview

The JSON API Auth plugin for WordPress contains an authentication bypass vulnerability affecting all versions up to and including 3.1.2. The flaw stems from the parent PI-Media/json-api plugin caching controller dispatch results in transients keyed only by URI and query string, ignoring HTTP method and POST body. As a result, the generate_auth_cookie() endpoint caches an authenticated response containing a live WordPress logged_in cookie. Any subsequent unauthenticated GET request to the same URI retrieves the cached response and the valid Administrator session cookie. The weakness is tracked as [CWE-287] Improper Authentication.

Critical Impact

Unauthenticated attackers can harvest a valid Administrator logged_in cookie from the cache and fully authenticate as the site Administrator for the remainder of the 24-hour transient TTL.

Affected Products

  • WordPress JSON API Auth plugin versions ≤ 3.1.2
  • Dependent on PI-Media/json-api parent plugin being installed and active
  • Any WordPress deployment with the Auth controller enabled

Discovery Timeline

  • 2026-10-02 - CVE-2026-97637 published to NVD
  • 2026-10-03 - Last updated in NVD database

Technical Details for CVE-2026-97637

Vulnerability Analysis

The JSON API Auth plugin exposes a /api/auth/generate_auth_cookie/ endpoint that issues a WordPress logged_in session cookie. The cookie is produced by wp_generate_auth_cookie() and embedded directly in the JSON response body returned to the authenticating user.

The parent PI-Media/json-api plugin wraps every controller dispatch in a WordPress transient cache. The cache key is derived solely from the request URI and query string. HTTP method, request headers, POST body, and authentication state are not part of the key. The transient lifetime is 24 hours.

When a legitimate Administrator POSTs valid credentials to the endpoint, the response, including the live logged_in cookie, is stored in the transient. Any later GET request to the identical URI returns the cached JSON. The attacker extracts the cookie and replays it against cookie-authenticated endpoints such as get_currentuserinfo, obtaining full Administrator control.

Root Cause

The root cause is cache-key insufficiency combined with sensitive data placement in cacheable responses. The dispatcher at json-api-auth.php line 65 relies on the parent plugin's cache behavior. Session material produced by Auth.php lines 66 and 77 is written into the response body rather than returned via a Set-Cookie header, so it is persisted alongside cacheable content.

Attack Vector

Exploitation is network-based and requires no authentication, user interaction, or privileges. The attacker must send a GET request to the same URI used by an Administrator within the preceding 24 hours. The HTTPS enforcement check at Auth.php line 104 can be bypassed by supplying insecure=cool as a request parameter, enabling plaintext retrieval. The vulnerability does not require any crafted payload — the cached JSON response is returned verbatim.

// Exploitation flow (prose description, no verified PoC available)
// 1. Administrator POSTs valid credentials to:
// /api/auth/generate_auth_cookie/?username=admin&password=...&insecure=cool
// 2. Parent plugin caches the JSON response, including the logged_in cookie,
// in a transient keyed only by URI + query string for 24 hours.
// 3. Unauthenticated attacker issues a GET to the same URI and receives the
// cached response containing the live Administrator logged_in cookie.
// 4. Attacker sets the cookie in a browser or client and calls
// /api/auth/get_currentuserinfo/ to validate full Administrator access.

Refer to WordPress Auth.php Line 104 and the Wordfence Vulnerability Analysis for annotated source references.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-97637

Indicators of Compromise

  • Unauthenticated GET requests to /api/auth/generate_auth_cookie/ returning HTTP 200 with a JSON body containing cookie or logged_in values.
  • Repeated requests to the same generate_auth_cookie URI from distinct source IPs within a 24-hour window.
  • Presence of the insecure=cool query parameter on auth endpoints over HTTP.
  • New Administrator-level actions in WordPress audit logs that are not preceded by a wp-login.php session.

Detection Strategies

  • Inspect WordPress wp_options entries for transients prefixed with the JSON API cache key that contain cookie material.
  • Alert on any HTTP response from /api/auth/ endpoints whose body matches regex patterns for WordPress auth cookies (wordpress_logged_in_[a-f0-9]{32}).
  • Correlate GET requests to generate_auth_cookie with absence of preceding POST authentication from the same client fingerprint.

Monitoring Recommendations

  • Enable verbose web server access logging for all /api/auth/* paths and forward to a central log platform.
  • Monitor for Administrator session use from IPs that have never submitted credentials to wp-login.php.
  • Baseline normal request volume to the JSON API endpoints and alert on volumetric anomalies.

How to Mitigate CVE-2026-97637

Immediate Actions Required

  • Deactivate and remove the JSON API Auth plugin until a fixed release is deployed.
  • Deactivate the PI-Media/json-api parent plugin or disable the Auth controller via its configuration.
  • Force logout of all active WordPress sessions and rotate the AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, and corresponding salts in wp-config.php to invalidate any leaked cookies.
  • Flush all WordPress transients to purge cached authenticated responses: wp transient delete --all.

Patch Information

A remediation changeset has been published in the WordPress plugin repository. Review WordPress Changeset 3712939 and upgrade to a version later than 3.1.2 once available for your site.

Workarounds

  • Block external access to /api/auth/generate_auth_cookie/ at the web application firewall or reverse proxy layer.
  • Deny any request containing the insecure=cool parameter and enforce HTTPS at the edge.
  • Restrict access to all /api/ paths to known administrator IP ranges until the plugin is patched or removed.
  • Reduce or disable the parent plugin's transient cache TTL to shorten the exposure window.
bash
# Example nginx configuration to block the vulnerable endpoint
location ~* ^/api/auth/generate_auth_cookie/ {
    return 403;
}

# Block the HTTPS-bypass parameter site-wide
if ($args ~* "insecure=cool") {
    return 403;
}

# WP-CLI commands to purge cached responses and rotate sessions
# wp transient delete --all
# wp user session destroy --all

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.