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-87940 Overview
CVE-2026-87940 affects the Drupal Key auth contributed module. The vulnerability stems from the module storing sensitive authentication data in the web browser cache. An attacker with access to a user's browser cache can retrieve this data and reuse it to bypass access control restrictions.
The issue is classified under [CWE-525: Use of Web Browser Cache Containing Sensitive Information]. It affects Key auth versions 0.0.0 through 2.2.4. Drupal published this issue in security advisory SA-CONTRIB-2026-138.
Critical Impact
Sensitive key authentication data persists in browser caches, allowing attackers with local or shared-device access to extract credentials and impersonate authenticated users.
Affected Products
- Drupal Key auth module versions 0.0.0 through 2.2.4
- Drupal sites using Key auth for API or endpoint authentication
- Shared or multi-user workstations accessing Drupal applications protected by Key auth
Discovery Timeline
- 2026-10-22 - CVE-2026-87940 published to NVD
- 2026-10-22 - Last updated in NVD database
- 2026 - Published in Drupal Security Advisory 2026-138
Technical Details for CVE-2026-87940
Vulnerability Analysis
The Key auth module provides key-based authentication for Drupal endpoints. The module returns responses containing sensitive authentication material without instructing the browser to avoid caching that content. HTTP responses lacking directives such as Cache-Control: no-store or Pragma: no-cache are eligible for storage in the browser's local cache.
An attacker who gains access to the browser cache files can recover authentication keys and session identifiers. This access can occur on shared workstations, through local malware, or via forensic recovery of cached disk content. Recovered keys allow the attacker to replay authenticated requests against the Drupal site.
The vulnerability does not require network interception or server compromise. Exploitation hinges on access to the client workstation after a legitimate user has authenticated. The access control weakness arises because the module trusts cached content handling to the browser rather than enforcing restrictive cache headers.
Root Cause
The root cause is the absence of HTTP cache-control directives on responses containing authentication secrets. The Key auth module through version 2.2.4 does not configure security levels that block caching of authenticated responses, violating the guidance in [CWE-525].
Attack Vector
An attacker gains read access to the local browser cache of a user who previously authenticated to a Drupal site using Key auth. The attacker parses cached HTTP responses, extracts the authentication key, and submits the key against the Drupal application. The server accepts the request as if issued by the legitimate user.
The vulnerability is described in prose because no verified public exploit code is available. See the Drupal Security Advisory 2026-138 for vendor technical details.
Detection Methods for CVE-2026-87940
Indicators of Compromise
- Authentication requests to Drupal endpoints originating from IP addresses or user agents inconsistent with the legitimate account owner
- Replay of identical authentication keys from multiple geographic locations within short timeframes
- Browser cache artifacts on endpoints containing Drupal API responses with authentication tokens
Detection Strategies
- Review Drupal access logs for repeated requests using the same Key auth key from different source addresses
- Audit response headers from Key auth endpoints for the presence of Cache-Control and Pragma directives
- Inspect endpoint browser cache directories for Drupal-origin resources containing key material
Monitoring Recommendations
- Enable verbose logging on the Drupal key_auth module and forward logs to a central SIEM for correlation
- Monitor for abnormal access patterns against API endpoints protected by Key auth
- Track module version inventory across Drupal deployments to confirm patched versions are in use
How to Mitigate CVE-2026-87940
Immediate Actions Required
- Upgrade the Drupal Key auth module to a version later than 2.2.4 as specified in Drupal Security Advisory 2026-138
- Rotate all API keys issued by Key auth after upgrading, invalidating any keys that may already reside in browser caches
- Audit shared workstations that accessed Drupal applications and clear browser caches storing authentication responses
Patch Information
Refer to the Drupal Security Advisory 2026-138 for the fixed version and upgrade instructions. The patched release adds appropriate HTTP cache-control headers to responses carrying sensitive authentication data.
Workarounds
- Configure the webserver or reverse proxy to inject Cache-Control: no-store, no-cache, must-revalidate and Pragma: no-cache on all Key auth endpoint responses
- Restrict Key auth-protected endpoints to trusted networks until the module is upgraded
- Instruct users to clear browser caches and avoid shared devices when accessing Drupal sites using Key auth
# Example Nginx directive to prevent caching of Key auth responses
location ~ ^/key-auth/ {
add_header Cache-Control "no-store, no-cache, must-revalidate, private" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
}
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

