Skip to content
OpenAdvisories

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

VendorProductAffectedFixed
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.

ReleasePackageFixed inAdvisory
Debian 14 flask 3.1.1-1 —
Debian 13 flask 3.1.1-1 —
ReleasePackageFixed inAdvisory
Ubuntu 25.04 flask 3.1.0-2ubuntu1.1 USN-7534-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-Flask 3.1.1-1.1 openSUSE-SU-2025:15152-1

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 python-flask No fix yet —
Azure Linux 2 (CBL-Mariner) python-flask No fix yet —

Wolfi

ReleasePackageFixed inAdvisory
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

EcosystemPackageAffectedFixedRecord
PyPI flask >= 3.1.0, < 3.1.1 3.1.1 GHSA-4grg-w6v8-c28g

Advisories 2

References