# CVE-2026-27205: Flask session does not add `Vary: Cookie` header when accessed in some ways

> Attackers can read sensitive session data from caches if Flask is behind a misconfigured proxy and session keys are accessed without values.

- **Severity:** Low 2.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 21 Feb 2026
- **Updated:** 24 Feb 2026
- **Also known as:** CLEANSTART-2026-BX07210, CLEANSTART-2026-UA33739, CLSA-2026-1789727592, CLSA-2026-1789986000, CLSA-2026-1789986625, DEBIAN-CVE-2026-27205, ECHO-32c7-8a8f-5df3, GHSA-68rp-wp8r-4726, MINI-8f6h-66c5-7cf4, MINI-pjv3-39p6-hx9v, OESA-2026-2135, OESA-2026-2136, OESA-2026-2137, PYSEC-2026-2151, ROOT-APP-PYPI-CVE-2026-27205, SUSE-SU-2026:0849-1, SUSE-SU-2026:22023-1, UBUNTU-CVE-2026-27205, USN-8104-1, openSUSE-SU-2026:10264-1, openSUSE-SU-2026:20885-1

## What is CVE-2026-27205?

CVE-2026-27205 is a low-severity vulnerability in pallets flask, published on 21 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-524 (Use of Cache Containing Sensitive Information)

## Which versions are affected by CVE-2026-27205?

3 open source packages ship an affected version, including flask. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `flask` | PyPI | All versions | 3.1.3 |
| `flask` | PyPI | All versions | 3.1.3 |
| `flask` | PyPI | All versions | 3.1.3 |
| `python-Flask` | SUSE:Linux Enterprise Module for Python 3 15 SP7 | All versions | 2.3.2-150400.3.9.1 |
| `python-Flask` | SUSE:Linux Enterprise Server 16.0 | All versions | 3.1.1-160000.3.1 |
| `python-Flask` | SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 3.1.1-160000.3.1 |
| `python-Flask` | openSUSE:Leap 15.6 | All versions | 2.3.2-150400.3.9.1 |
| `python-Flask` | openSUSE:Tumbleweed | All versions | 3.1.3-1.1 |

Products: Palletsprojects Flask.

## How do I fix CVE-2026-27205?

Upgrade flask to 3.1.3 or later.

## Is CVE-2026-27205 being exploited?

There is no known exploitation of CVE-2026-27205 in the wild and no public exploit code.

## Other vulnerabilities in pallets flask

- [CVE-2023-30861](https://insights.sbomify.com/CVE-2023-30861/): Flask vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header (high 7.5)
- [CVE-2019-1010083](https://insights.sbomify.com/CVE-2019-1010083/): Pallets Project Flask is vulnerable to Denial of Service via Unexpected memory usage (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-27205 and fix it if it is affected.

What it is: CVE-2026-27205 is a low-severity vulnerability in pallets flask, published on 21 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-27205 in the wild and no public exploit code.

Affected packages and fixed versions:
- flask (PyPI): affected all versions; fixed in 3.1.3
- flask (PyPI): affected all versions; fixed in 3.1.3
- flask (PyPI): affected all versions; fixed in 3.1.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-27205/ (Markdown: https://insights.sbomify.com/CVE-2026-27205/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-27205
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-27205
- OSV: https://osv.dev/vulnerability/CVE-2026-27205

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-27205/
Summaries are generated and may contain mistakes; the official description above is the record.
