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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pallets | flask | = 3.1.0 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | flask | 3.1.1-1 | — |
| Debian 13 | flask | 3.1.1-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.04 | flask | 3.1.0-2ubuntu1.1 | USN-7534-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Flask | 3.1.1-1.1 | openSUSE-SU-2025:15152-1 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-flask | No fix yet | — |
| Azure Linux 2 (CBL-Mariner) | python-flask | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | airflow-3 +3 | 3.0.1-r1 | — |
| Wolfi rolling | emissary +6 | 3.10.0-r3 | — |
| Wolfi rolling | kubeflow-jupyter-web-app | 1.10.0-r2 | — |
| Wolfi rolling | kubeflow-volumes-web-app | 1.10.0-r1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | flask | >= 3.1.0, < 3.1.1 | 3.1.1 | GHSA-4grg-w6v8-c28g |
Advisories 2
- openSUSE-SU-2025:15152-1 python311-Flask-3.1.1-1.1 on GA media SUSE / openSUSE Security Updates · Mar 23, 2026
- USN-7534-1 flask vulnerability Ubuntu Security Notices (USN) · Oct 13, 2025