Advisory

PYSEC-2026-1377

Also known as: CVE-2025-47278, GHSA-4grg-w6v8-c28g

Summary

Flask uses fallback key instead of current signing key

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.

Severity

Not rated by the source.

Dates

Published
2026-07-07 16:02 UTC
Modified
2026-07-07 17:47 UTC

Affected packages and fixes

flask

PyPI · All systems

Affected

  • introduced 3.1.0, fixed 3.1.1 (ecosystem)

Fixed versions

3.1.1

Fix

  • Fixed version 3.1.1
    pip install --upgrade flask==3.1.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences