{"id":"CVE-2025-47278","published":"2025-05-13T15:57:40Z","modified":"2025-05-13T20:14:09Z","title":"Flask uses fallback key instead of current signing key","vendor":"pallets","product":"flask","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":1.8,"severity":"LOW","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00279,"percentile":0.12983,"provenance":"source"},"cwes":[{"id":"CWE-683","name":"Function Call With Incorrect Order of Arguments"}],"references":[{"url":"https://github.com/pallets/flask/security/advisories/GHSA-4grg-w6v8-c28g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09","tags":["x_refsource_MISC"]},{"url":"https://github.com/pallets/flask/releases/tag/3.1.1","tags":["x_refsource_MISC"]}],"priority":{"score":3.9,"factors":[{"name":"EPSS percentile","points":2.6},{"name":"CVSS severity","points":1.26}]},"vendorSlug":"pallets","affectedVersions":[{"vendor":"pallets","product":"flask","versions":["= 3.1.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-05-13T20:13:56.371838Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"flask","vulnerableRanges":[">=3.1.0, <3.1.1"],"patched":["3.1.1"],"from":["GHSA-4grg-w6v8-c28g","PYSEC-2026-1377"],"provenance":"source"}],"summary":{"text":"Flask 3.1.0 builds its list of signing keys in reverse order when handling the SECRET_KEY_FALLBACKS configuration, causing the stale fallback key to be used for signing sessions instead of the current key, which is in the Flask web application framework's session signing path (via itsdangerous). An attacker would need local access and high privileges to the system, and the issue is only relevant to sites that have enabled key rotation through SECRET_KEY_FALLBACKS, where sessions get signed with outdated keys rather than the intended current one.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:38Z"},"euvd":{"id":"EUVD-2025-14386","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pallets-flask-cve-2023-30861","parents":[{"from":"CVE-2023-30861","to":"CVE-2025-47278","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/flask/sessions.py"],"commits":["https://github.com/pallets/flask/commit/70f906c51ce49c485f1d355703e9cc3386b1cc2b","https://github.com/pallets/flask/commit/afd63b16170b7c047f5758eb910c416511e9c965","https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09"],"basis":"rarely changed file"}]}],"children":[{"from":"CVE-2025-47278","to":"CVE-2026-27205","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:flask","fromFixed":"3.1.1","toFixed":"3.1.3","daysApart":284},{"kind":"same-code","provenance":"machine","files":["src/flask/sessions.py"],"commits":["https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09","https://github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2025-47278","published":"2025-05-13","fixed":"3.1.1","kev":false},{"cve":"CVE-2026-27205","published":"2026-02-21","fixed":"3.1.3","kev":false}],"package":"PyPI:flask"}}