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

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

- **Severity:** Low 1.8 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 May 2025
- **Updated:** 13 May 2025
- **Also known as:** AZL-77828, AZL-77831, DEBIAN-CVE-2025-47278, ECHO-591b-96c8-dac8, GHSA-4grg-w6v8-c28g, PYSEC-2026-1377, USN-7534-1, openSUSE-SU-2025:15152-1

## 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 (Function Call With Incorrect Order of Arguments)

## Which versions are affected by CVE-2025-47278?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `flask` | PyPI | From 3.1.0 | 3.1.1 |
| `flask` | PyPI | From 3.1.0 | 3.1.1 |
| `flask` | PyPI | From 3.1.0 | 3.1.1 |
| `python-Flask` | openSUSE:Tumbleweed | All versions | 3.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.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-47278 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2025-47278 in the wild and no public exploit code.

Affected packages and fixed versions:
- flask (PyPI): affected from 3.1.0; fixed in 3.1.1
- flask (PyPI): affected from 3.1.0; fixed in 3.1.1
- flask (PyPI): affected from 3.1.0; fixed in 3.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-47278/ (Markdown: https://insights.sbomify.com/CVE-2025-47278/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-47278
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-47278
- OSV: https://osv.dev/vulnerability/CVE-2025-47278

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-47278/
Summaries are generated and may contain mistakes; the official description above is the record.
