Critical Flask Vulnerability: Key Rotation Flaw in Package Version 3.1.0-2ubuntu1.1

flask Updated 03 Oct 2025

Summary

26/05/2025
N/A
Yes i
Unrated
Not published

USN-7534-1: flask vulnerability. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Flask is a popular web framework for Python, designed to make it easy to build web applications quickly and with minimal code. It is lightweight and modular, allowing developers to choose the components they need. However, a recent vulnerability has been identified in version 3.1.0-2ubuntu1.1, which affects its ability to securely handle key rotation, potentially compromising session security.

Vulnerability Detail

The vulnerability arises from Flask's improper handling of key rotation. This flaw allows an attacker to sign sessions using outdated keys, which can lead to unauthorized access and session hijacking. The issue is particularly concerning as it undermines the integrity of session management, a critical aspect of web application security.

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, you can implement additional session validation mechanisms or limit the session lifespan to reduce the risk of stale keys being used. However, updating to the patched version is the most effective solution.

Conclusion

In summary, the identified vulnerability in Flask poses a significant risk to web applications by allowing session signing with stale keys. It is crucial to update to the patched version to mitigate this risk effectively. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for flask →

Share this vulnerability

FAQ

The vulnerability involves improper key rotation handling, which could allow attackers to sign sessions with outdated keys.

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

If exploited, this vulnerability could lead to session hijacking, allowing attackers to impersonate legitimate users.

Yes, the patched version of Flask is 3.1.0-2ubuntu1.1, which addresses this vulnerability.

If immediate updates are not possible, consider implementing additional session validation or reducing session lifetimes as a temporary measure.

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