Flask 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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-27205
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 18:01 UTC · Revision 1
Source evidence
Flask session does not add `Vary: Cookie` header when accessed in some ways
core-osv · Original sourcePublished 21 Feb 2026, 05:21 UTC
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.
osv:CVE-2026-27205
Complete source record
{
"id": "799f7c75cb75901e7c88cc5409ce4f0041761ebef2a5a3be0d6a33085a684440",
"url": "https://osv.dev/vulnerability/CVE-2026-27205",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Flask session does not add `Vary: Cookie` header when accessed in some ways",
"summary": "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.",
"evidence": "osv:CVE-2026-27205",
"products": [],
"severity": "low",
"structured": {
"id": "CVE-2026-27205",
"aliases": [
"CVE-2026-27205",
"GHSA-68rp-wp8r-4726",
"PYSEC-2026-2151"
],
"metrics": [
{
"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": [
{
"ranges": [
{
"repo": "https://github.com/pallets/flask",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "22d924701a6ae2e4cd01e9a15bbaf3946094af65"
},
{
"fixed": "089cb86dd22bff589a4eafb7ab8e42dc357623b4"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:palletsprojects:flask:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "3.1.3"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "089cb86dd22bff589a4eafb7ab8e42dc357623b4"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "22d924701a6ae2e4cd01e9a15bbaf3946094af65"
}
],
"source": "REFERENCES_TAG",
"original_tag": "3.1.3"
}
]
}
}
],
"versions": [
"2.2.0",
"2.1.0",
"2.0.0",
"2.0.0rc2",
"2.0.0rc1",
"1.1.0",
"0.10.1",
"0.10",
"0.9",
"0.8",
"0.7",
"0.6",
"0.5",
"0.4",
"0.3",
"0.2",
"0.1"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-27205.json"
}
}
],
"modified": "2026-10-28T02:30:22.002521921Z",
"provider": "osv",
"references": [
"https://github.com/pallets/flask/releases/tag/3.1.3",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27205.json",
"https://github.com/pallets/flask/security/advisories/GHSA-68rp-wp8r-4726",
"https://nvd.nist.gov/vuln/detail/CVE-2026-27205",
"https://github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4"
],
"provider_metadata": {
"cwe_ids": [
"CWE-524"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27205.json"
}
},
"related_cves": [
{
"value": "CVE-2026-27205",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 488049,
"published_at": "2026-02-21T05:21:17.214+00:00"
}