CVE-2026-27205Flask session does not add `Vary: Cookie` header when accessed in some ways
Flask is a web server gateway interface (WSGI) web application framework. In versions 3.1.2 and below, when the session object is accessed, Flask should set the Vary: Cookie header., resulting in a Use of Cache Containing Sensitive Information vulnerability. The logic 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 and risk depend on the application being hosted behind a caching proxy that doesn't ignore responses with cookies, not setting a Cache-Control header to mark pages as private or non-cacheable, and accessing the session in a way that only touches keys without reading values or mutating the session. The issue has been fixed in version 3.1.3.
What to do
Fixed builds are available from Debian, PyPI, Ubuntu: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | flask | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | flask | Will not fix version in bionic and xenial do not have functionality to to set the vary cookie header as it was only introduced in upstream in version 1.0 | UBUNTU-CVE-2026-27205 | |
| Ubuntu 24.04 | flask | Fixed | 3.0.2-1ubuntu1.1 | UBUNTU-CVE-2026-27205 |
| Ubuntu 22.04 | flask | Fixed | 2.0.1-2ubuntu1.2 | UBUNTU-CVE-2026-27205 |
| Ubuntu 20.04 | flask | Fix pending | 1.1.1-2ubuntu0.1+esm1 (Ubuntu Pro) | UBUNTU-CVE-2026-27205 |
| Ubuntu 18.04 | flask | Fix pending | UBUNTU-CVE-2026-27205 | |
| Ubuntu 16.04 | flask | Fix pending | UBUNTU-CVE-2026-27205 | |
| Debian 14 | flask | Fixed | 3.1.3-1 | DEBIAN-CVE-2026-27205 |
| Debian 13 | flask | Fixed | 3.1.1-1+deb13u1 | DEBIAN-CVE-2026-27205 |
| Debian 12 | flask | Fix pending | DEBIAN-CVE-2026-27205 | |
| PyPI library | flask | Fixed | 3.1.3 | PYSEC-2026-2151 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- pallets flask: affected: < 3.1.3
References
- https://github.com/pallets/flask/security/advisories/GHSA-68rp-wp8r-4726
- https://github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4
- https://github.com/pallets/flask/releases/tag/3.1.3
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.