Vulnerabilities in pkg:pypi/flask

PACKAGE
Advisory Identifier: GHSA-68rp-wp8r-4726
Advisory Summary

CVE-2026-27205 is a LOW cookie` header when accessed vulnerability (CWE-524: Use of Cache Containing Sensitive Information) affecting Flask session does not add `Vary libraries in the PyPI ecosystem. The issue involves cookie` header when accessed in some ways. Remediation is available by upgrading affected packages to version 3.1.3.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/flask

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/flask. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-68rp-wp8r-4726 CVE-2026-27205 LOW Flask session does not add `Vary: Cookie` header when accessed in some ways
GHSA-4grg-w6v8-c28g CVE-2025-47278 LOW Flask uses fallback key instead of current signing key

CVE-2026-27205 at a Glance

CVE Identifier CVE-2026-27205
GHSA Identifier GHSA-68rp-wp8r-4726
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-524: Use of Cache Containing Sensitive Information
Affected Product Flask session does not add `Vary
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-27205

To remediate this vulnerability, upgrade all affected Flask session does not add `Vary 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.3
pip install flask>=3.1.3
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-2026-27205, inspect your installed packages using pip:

pip show flask

Analyze the terminal output to locate any version of Flask session does not add `Vary in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.3), 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-524: Use of Cache Containing Sensitive Information, where the code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere. In Flask session does not add `Vary, 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

When the `session` object is accessed, Flask should set the `Vary: Cookie` header. This instructs caches not to cache the response, as it may contain information specific to a logged in user. This is handled in most cases, but some forms of access such as the Python `in` operator were overlooked. The severity depends on the application's use of the session, and the cache's behavior regarding cookies. The risk depends on all these conditions being met. 1. The application must be hosted behind a caching proxy that does not ignore responses with cookies. 2. The application does not set a `Cache-Control` header to indicate that a page is private or should not be cached. 3. The application accesses the session in a way that does not access the values, only the keys, and does not mutate the session.

CVE-2026-27205 Affected Flask session does not add `Vary Versions

1 component(s)
Fixed Versions:
3.1.3
Product / Package Ecosystem Affected Versions Fixed Version
flask
PyPI
< 3.1.3
3.1.3

References

Frequently Asked Questions

What is CVE-2026-27205?
CVE-2026-27205 is a security vulnerability in Flask session does not add `Vary involving Cookie` header when accessed in some ways under CWE-524: Use of Cache Containing Sensitive Information.
Which Flask session does not add `Vary versions are affected?
Affected versions include releases prior to 3.1.3 across affected packages: flask.
What version fixes CVE-2026-27205?
Upgrading to 3.1.3 (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.3. Upgrade your dependency to 3.1.3 or later.
What CWE is associated with CVE-2026-27205?
CVE-2026-27205 is classified under CWE-524: Use of Cache Containing Sensitive Information (The code uses a cache that contains sensitive information, but the cache can be read by an actor outside of the intended control sphere.).
How can I check PyPI dependencies for CVE-2026-27205?
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-68rp-wp8r-4726",
  "modified" : "2026-02-23T22:28:03Z",
  "published" : "2026-02-19T20:45:41Z",
  "aliases" : [ "CVE-2026-27205" ],
  "summary" : "Flask session does not add `Vary: Cookie` header when accessed in some ways",
  "details" : "When the `session` object is accessed, Flask should set the `Vary: Cookie` header. This instructs caches not to cache the response, as it may contain information specific to a logged in user. This is handled in most cases, but some forms of access such as the Python `in` operator were overlooked.\n\nThe severity depends on the application's use of the session, and the cache's behavior regarding cookies. The risk depends on all these conditions being met.\n\n1. The application must be hosted behind a caching proxy that does not ignore responses with cookies.\n2. The application does not set a `Cache-Control` header to indicate that a page is private or should not be cached.\n3. The application accesses the session in a way that does not access the values, only the keys, and does not mutate the session.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "flask"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/security/advisories/GHSA-68rp-wp8r-4726"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27205"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pallets/flask"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pallets/flask/releases/tag/3.1.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-524" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-19T20:45:41Z",
    "nvd_published_at" : "2026-02-21T06:17:00Z"
  }
}