6.5medium
Flask-HTTPAuth invokes token verification callback when missing or empty token was given by client
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.37% (higher than 32% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-p44q-vqpr-4xmgPYSEC-2026-2152
Description
Flask-HTTPAuth provides Basic, Digest and Token HTTP authentication for Flask routes. Prior to version 4.8.1, in a situation where the client makes a request to a token protected resource without passing a token, or passing an empty token, Flask-HTTPAuth would invoke the application's token verification callback function with the token argument set to an empty string. If the application had any users in its database with an empty string set as their token, then it could potentially authenticate the client request against any of those users. This issue has been patched in version 4.8.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| miguelgrinberg Flask-HTTPAuth | < 4.8.1, before 4.8.1 | CVE List, NVD |
| flask-httpauth (PyPI) | before 4.8.1 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N |
| NVD | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N |
| PyPA Advisory Database | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Flask-HTTPAuth provides Basic, Digest and Token HTTP authentication for Flask routes. Prior to version 4.8.1, in a situation where the client makes a request to a token protected resource without passing a token, or passing an empty token, Flask-HTTPAuth would invoke the application's token verification callback function with the token argument set to an empty string. If the application had any users in its database with an empty string set as their token, then it could potentially authenticate the client request against any of those users. This issue has been patched in version 4.8.1.
GitHub Advisory Database
Summary
In a situation where the client makes a request to a token protected resource without passing a token, or passing an empty token, Flask-HTTPAuth would invoke the application's token verification callback function with the token argument set to an empty string. If the application had any users in its database with an empty string set as their token, then it could potentially authenticate the client request against any of those users.
Notes
- This issue applies only to token authentication
- This issue applies only when the application verifies tokens by searching for them in a user database.
- This issue applies only if the application stores empty strings as user tokens when the user does not have an assigned token. It does not apply if the application sets those tokens to
NULLinstead. - Tokens that are verified through cryptographic means (such as JWTs) are not affected by this issue.
- Basic and Digest authentication are not affected by this issue.
Remediation
To protect against this issue, developers should make sure that no user in the user database has their token set to an empty string. If there are such users, change the value of those tokens to NULL instead.
Alternatively, developers can upgrade their projects to Flask-HTTPAuth>=4.8.1, which fixes this issue.
NVD (es)
Flask-HTTPAuth proporciona autenticación HTTP Basic, Digest y por Token para rutas de Flask. Antes de la versión 4.8.1, en una situación donde el cliente realiza una solicitud a un recurso protegido por token sin pasar un token, o pasando un token vacío, Flask-HTTPAuth invocaría la función de callback de verificación de token de la aplicación con el argumento del token establecido como una cadena vacía. Si la aplicación tenía usuarios en su base de datos con una cadena vacía establecida como su token, entonces podría potencialmente autenticar la solicitud del cliente contra cualquiera de esos usuarios. Este problema ha sido parcheado en la versión 4.8.1.
References
| https://github.com/miguelgrinberg/Flask-HTTPAuth/security/advisories/GHSA-p44q-vqpr-4xmg | advisory, mitigation, vendor-advisory, web | |
| https://github.com/miguelgrinberg/flask-httpauth/commit/b15ffe9e50e110d7174ccd944f642079e1dcf9ee | fix, patch, web | |
| https://github.com/miguelgrinberg/Flask-HTTPAuth/releases/tag/v4.8.1 | advisory, product, release-notes, web | |
| https://lists.debian.org/debian-lts-announce/2026/05/msg00049.html | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-34531 | advisory | |
| https://github.com/miguelgrinberg/Flask-HTTPAuth | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34531 changed 2026-05-28 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-p44q-vqpr-4xmg changed 2026-07-13 | CC-BY-4.0 |
| NVD | CVE-2026-34531 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2152 changed 2026-07-13 | CC-BY-4.0 |