CVE-2025-47278
JSON

1.8low

Flask uses fallback key instead of current signing key

Severity
1.8low CVSS:4.0 by GitHub_M
Exploit likelihood
0.19% (higher than 9% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4grg-w6v8-c28gPYSEC-2026-1377

Description

Flask is a web server gateway interface (WSGI) web application framework. In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key. Signing is provided by the `itsdangerous` library. A list of keys can be passed, and it expects the last (top) key in the list to be the most recent key, and uses that for signing. Flask was incorrectly constructing that list in reverse, passing the signing key first. Sites that have opted-in to use key rotation by setting `SECRET_KEY_FALLBACKS` care likely to unexpectedly be signing their sessions with stale keys, and their transition to fresher keys will be impeded. Sessions are still signed, so this would not cause any sort of data integrity loss. Version 3.1.1 contains a patch for the issue.

Affected

Product or packageVersionsReported by
pallets flask= 3.1.0CVE List
flask (PyPI)from 3.1.0 before 3.1.1GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M1.8low CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
GitHublow CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Classification

CWE-683

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Flask is a web server gateway interface (WSGI) web application framework. In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key. Signing is provided by the `itsdangerous` library. A list of keys can be passed, and it expects the last (top) key in the list to be the most recent key, and uses that for signing. Flask was incorrectly constructing that list in reverse, passing the signing key first. Sites that have opted-in to use key rotation by setting `SECRET_KEY_FALLBACKS` care likely to unexpectedly be signing their sessions with stale keys, and their transition to fresher keys will be impeded. Sessions are still signed, so this would not cause any sort of data integrity loss. Version 3.1.1 contains a patch for the issue.

GitHub Advisory Database

In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key.

Signing is provided by the itsdangerous library. A list of keys can be passed, and it expects the last (top) key in the list to be the most recent key, and uses that for signing. Flask was incorrectly constructing that list in reverse, passing the signing key first.

Sites that have opted-in to use key rotation by setting SECRET_KEY_FALLBACKS are likely to unexpectedly be signing their sessions with stale keys, and their transition to fresher keys will be impeded. Sessions are still signed, so this would not cause any sort of data integrity loss.

NVD (es)

Flask es un framework de aplicaciones web con interfaz de puerta de enlace de servidor web (WSGI). En Flask 3.1.0, la configuración de la clave de reserva hacía que se usara la última clave de reserva para firmar, en lugar de la clave de firma actual. La librería `itsdangerous` proporciona la firma. Se puede pasar una lista de claves, y Flask espera que la última clave (la superior) sea la más reciente, utilizándola para firmar. Sin embargo, Flask construía incorrectamente esa lista a la inversa, pasando primero la clave de firma. Es probable que los sitios que hayan optado por la rotación de claves mediante `SECRET_KEY_FALLBACKS` firmen inesperadamente sus sesiones con claves obsoletas, lo que dificultará la transición a claves más recientes. Las sesiones siguen firmadas, por lo que esto no causaría ninguna pérdida de integridad de los datos. La versión 3.1.1 incluye un parche para este problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-47278 changed 2025-05-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-4grg-w6v8-c28g changed 2026-09-10CC-BY-4.0
NVDCVE-2025-47278 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1377 changed 2026-07-07CC-BY-4.0