Flask Package Vulnerability: Key Rotation Issue in Version 3.1.0

flask Updated 14 Dec 2025

Summary

13/05/2025
N/A
Yes i
Low
1.8

UBUNTU-CVE-2025-47278: Flask is a web server gateway interface (WSGI) web application framework. Affects flask versions < 3.1.0-2ubuntu1.1. Fixed in 3.1.0-2ubuntu1.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Flask is a popular web server gateway interface (WSGI) web application framework that allows developers to build web applications quickly and efficiently. It is known for its simplicity and flexibility, making it a preferred choice for many developers. However, in version 3.1.0, Flask introduced a vulnerability related to the handling of fallback key configuration, which could lead to security concerns for applications that utilize key rotation.

Vulnerability Detail

In Flask version 3.1.0, the framework mishandled the configuration of fallback keys, resulting in the last fallback key being used for signing instead of the current signing key. This issue arises from the way the itsdangerous library constructs the list of keys, expecting the last key to be the most recent. As a result, sites using key rotation with the SECRET_KEY_FALLBACKS setting may inadvertently sign sessions with outdated keys, potentially compromising the security of session management. Although sessions remain signed, this flaw does not lead to data integrity loss, but it does impede the transition to newer keys.

How To Fix

Minimum fixed version

3.1.0-2ubuntu1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade flask

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, if you cannot update Flask immediately, consider disabling key rotation by not setting the SECRET_KEY_FALLBACKS configuration. However, this is not a long-term solution and should be addressed by updating to the patched version as soon as possible.

Conclusion

The Flask vulnerability in version 3.1.0 poses a risk to applications utilizing key rotation, as it may lead to the use of outdated signing keys. It is crucial to update to version 3.1.1 or later to mitigate this risk and ensure the security of session management.

See every vulnerability recorded for flask →

Share this vulnerability

FAQ

The vulnerability can lead to applications signing sessions with outdated keys, which may affect the security of session management.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

No, while sessions are still signed, there is no data integrity loss associated with this vulnerability.

As a temporary measure, you can disable key rotation by not using the SECRET_KEY_FALLBACKS configuration.

Related vulnerabilities

Recent vulnerabilities recorded for flask.

How To Fix

Minimum fixed version

3.1.0-2ubuntu1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade flask

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback