CVE-2025-47278 Flask uses fallback key instead of current signing key

Low 1.8 Published Updated

Flask incorrectly uses stale fallback keys for session signing when key rotation is enabled, potentially impeding secure key transitions.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-47278?

CVE-2025-47278 is a low-severity vulnerability in pallets flask, published on 13 May 2025. It can only be exploited from the same machine or local network, with no action from the victim.

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

Weakness: CWE-683

Which versions are affected by CVE-2025-47278?

3 open source packages ship an affected version, including flask.

PackageAffectedFixed in
flask PyPIFrom 3.1.03.1.1
flask PyPIFrom 3.1.03.1.1
flask PyPIFrom 3.1.03.1.1
Linux distribution packages (1)
python-Flask openSUSE:TumbleweedAll versions3.1.1-1.1

How do I fix CVE-2025-47278?

Upgrade flask to 3.1.1 or later.

Is CVE-2025-47278 being exploited?

There is no known exploitation of CVE-2025-47278 in the wild and no public exploit code.

Sources

Also known as AZL-77828, AZL-77831, DEBIAN-CVE-2025-47278, ECHO-591b-96c8-dac8, GHSA-4grg-w6v8-c28g, PYSEC-2026-1377 and 2 more.

Is CVE-2025-47278 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free