CVE-2026-34531
Python vulnerability analysis and mitigation

Overview

CVE-2026-34531 is an improper authentication vulnerability in Flask-HTTPAuth, a Python extension that provides HTTP authentication for Flask routes. When a client makes a request to a token-protected resource without providing a token or with an empty token, Flask-HTTPAuth incorrectly invokes the application's token verification callback with the token argument set to an empty string rather than rejecting the request outright. If the application's user database contains any users with an empty string stored as their token value, the request may be authenticated against those users, effectively bypassing authentication. All versions of Flask-HTTPAuth up to and including 4.8.0 are affected; the issue was disclosed by the maintainer on March 28, 2026, and published to the GitHub Advisory Database on March 31, 2026. The GitHub Advisory rates this as Moderate with a CVSS v3.1 score of 6.5, while Feedly's aggregated data assigns a score of 8.2 (High) (Github Advisory, Flask-HTTPAuth Advisory).

Technical details

The root cause is classified as CWE-287 (Improper Authentication). In the vulnerable code path within src/flask_httpauth.py, the authenticate method retrieved the token using getattr(auth, 'token', ''), defaulting to an empty string when no token was present, and then passed this empty string directly to the application's verify_token_callback without first checking whether the token was non-empty (Patch Commit). The fix changes the default to None and adds a truthiness check (if token and self.verify_token_callback) so that empty or missing tokens are rejected before the callback is ever invoked. Exploitation requires a specific precondition: the target application must store empty strings (rather than NULL) as token values for users who have not been assigned a token. This vulnerability does not affect JWT-based or cryptographic token verification, nor Basic or Digest authentication schemes (Github Advisory).

Impact

Successful exploitation allows an unauthenticated attacker to bypass token-based access controls and gain unauthorized access to protected API endpoints or resources. The confidentiality impact is low (partial data exposure), while the integrity impact is high — an attacker authenticated as a user with an empty token could perform any action that user is authorized to perform, including modifying or deleting data. Availability is not directly impacted. The scope of affected assets depends on the application's authorization model; in multi-tenant or privileged-access scenarios, this could enable significant unauthorized data access or manipulation (Flask-HTTPAuth Advisory, Github Advisory).

Exploitability

There is no public proof-of-concept exploit code and no evidence of in-the-wild exploitation at this time (Github Advisory). The EPSS score is approximately 0.019–0.038%, indicating a low near-term probability of exploitation. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation is conceptually straightforward — sending a request with an empty or absent Authorization token — but requires the specific precondition of empty-string tokens existing in the target application's database, which limits the practical attack surface.

Exploitation steps

  1. Reconnaissance: Identify Flask-based web applications using Flask-HTTPAuth for token authentication (e.g., via HTTP response headers, error messages, or open-source intelligence on the target's technology stack). Confirm the application version is 4.8.0 or earlier.
  2. Probe for token-protected endpoints: Send unauthenticated requests to API endpoints to identify those that return a 401 Unauthorized response with a WWW-Authenticate header indicating token-based auth (e.g., WWW-Authenticate: Bearer realm="...")
  3. Send empty token request: Issue an HTTP request to a protected endpoint with an empty or absent token value, for example:
    GET /api/protected HTTP/1.1
    Host: target.example.com
    Authorization: Bearer 
    or omit the Authorization header entirely.
  4. Observe response: If the application has users with empty string tokens in its database, the server will invoke the token verification callback with an empty string, potentially matching one of those users and returning a 200 OK response with protected data.
  5. Access protected resources: Use the same empty-token request pattern to interact with any token-protected endpoint, performing reads or writes as the matched user (Flask-HTTPAuth Advisory, Patch Commit).

Indicators of compromise

  • Network: HTTP requests to token-protected API endpoints with an empty Authorization header value (e.g., Authorization: Bearer with no token following the scheme) or with the Authorization header entirely absent, followed by unexpected 200 OK responses instead of 401.
  • Logs: Web server or application access logs showing repeated requests to protected endpoints from the same source IP with empty or missing Authorization tokens that result in successful (non-401) responses; anomalous access patterns from accounts that should not have active tokens.
  • Application: Unexpected authenticated sessions or API activity attributed to user accounts that have no assigned token (i.e., users with empty string token fields in the database).

Mitigation and workarounds

The primary remediation is to upgrade Flask-HTTPAuth to version 4.8.1 or later, which rejects empty or missing tokens before invoking the verification callback (Flask-HTTPAuth Release, Patch Commit). For applications that cannot immediately upgrade, audit the user database and change any empty string ('') token values to NULL — this prevents the callback from matching an empty token to a real user. After remediation, review authentication logs for any suspicious access patterns that may indicate prior exploitation (Github Advisory).

Community reactions

The vulnerability was reported by security researcher npbhatter17 and disclosed responsibly by maintainer Miguel Grinberg, who published the advisory and patch simultaneously on March 28, 2026 (Flask-HTTPAuth Advisory). The issue was subsequently picked up by downstream Linux distributions including Debian LTS and openSUSE, which issued their own security announcements. No significant social media controversy or broad community debate has been observed, consistent with the narrow exploitation preconditions limiting the practical impact.

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50027CRITICAL9.8
  • Python logoPython
  • mcp-memory-service
NoYesAug 14, 2026
CVE-2026-49986HIGH7.1
  • Python logoPython
  • neuro-cortex-memory
NoYesAug 14, 2026
CVE-2026-53708MEDIUM6.6
  • Python logoPython
  • mcp-contextforge-gateway
NoYesAug 14, 2026
CVE-2026-47192LOW2.1
  • Python logoPython
  • kas
NoYesAug 14, 2026
CVE-2026-47191LOW2.1
  • Python logoPython
  • kas
NoYesAug 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management