CVE-2025-47278: Flask Flask Uses Fallback Key Instead Vulnerability

LOW
Advisory Identifier: GHSA-4grg-w6v8-c28g
CWE-683
Published
Advisory Summary

CVE-2025-47278 is a LOW flask uses fallback key instead vulnerability (CWE-683: Function Call With Incorrect Order of Arguments) affecting Flask libraries in the PyPI ecosystem. The issue involves flask uses fallback key instead of current signing key. Remediation is available by upgrading affected packages to version 3.1.1.

CVE-2025-47278 at a Glance

CVE Identifier CVE-2025-47278
GHSA Identifier GHSA-4grg-w6v8-c28g
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-683: Function Call With Incorrect Order of Arguments
Affected Product Flask
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-47278

To remediate this vulnerability, upgrade all affected Flask dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

flask fixed: 3.1.1
pip install flask>=3.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show flask

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-47278, inspect your installed packages using pip:

pip show flask

Analyze the terminal output to locate any version of Flask in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.1), your application is affected.

Note: The pip show flask command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-683: Function Call With Incorrect Order of Arguments, where the product calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses. In Flask, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-47278 Affected Flask Versions

1 component(s)
Fixed Versions:
3.1.1
Product / Package Ecosystem Affected Versions Fixed Version
flask
PyPI
≥ 3.1.0
< 3.1.1
All 1 versions
3.1.0
3.1.1

References

Frequently Asked Questions

What is CVE-2025-47278?
CVE-2025-47278 is a security vulnerability in Flask involving Flask uses fallback key instead of current signing key under CWE-683: Function Call With Incorrect Order of Arguments.
Which Flask versions are affected?
Affected versions include releases prior to 3.1.1 across affected packages: flask.
What version fixes CVE-2025-47278?
Upgrading to 3.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flask affected?
Yes, flask is affected in releases prior to 3.1.1. Upgrade your dependency to 3.1.1 or later.
What CWE is associated with CVE-2025-47278?
CVE-2025-47278 is classified under CWE-683: Function Call With Incorrect Order of Arguments (The product calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses.).
How can I check PyPI dependencies for CVE-2025-47278?
Run the dependency tree command: 'pip show flask'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4grg-w6v8-c28g",
  "modified" : "2025-05-13T20:25:26Z",
  "published" : "2025-05-13T20:25:26Z",
  "aliases" : [ "CVE-2025-47278" ],
  "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.\n\nSigning 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.\n\nSites 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" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "flask"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.0"
      }, {
        "fixed" : "3.1.1"
      } ]
    } ],
    "versions" : [ "3.1.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/security/advisories/GHSA-4grg-w6v8-c28g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-47278"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pallets/flask"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/releases/tag/3.1.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-683" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-13T20:25:26Z",
    "nvd_published_at" : "2025-05-13T16:15:32Z"
  }
}