Flask uses fallback key instead of current signing key
Published 13 May 2025 · Updated 10 Sept 2026
Is your project on an affected flask?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=3.1.0 <3.1.1
- Fixed in
- 3.1.1
pip install 'flask>=3.1.1'Details
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.
Is GHSA-4grg-w6v8-c28g in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected flask, and gives you the command that fixes it.
More advisories for flask
- LowCVE-2026-27205Flask session does not add `Vary: Cookie` header when accessed in some ways · 19 Feb 2026
- HighCVE-2023-30861Flask vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header · 1 May 2023
- HighCVE-2019-1010083Pallets Project Flask is vulnerable to Denial of Service via Unexpected memory usage · 19 Jul 2019
- HighCVE-2018-1000656Flask is vulnerable to Denial of Service via incorrect encoding of JSON data · 23 Aug 2018
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.