Flask session does not add `Vary: Cookie` header when accessed in some ways
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
flaskPyPI | < 3.1.3 | 3.1.3 |
Affected products
29- osv-coords28 versionspkg:apk/chainguard/airflow-2pkg:apk/chainguard/airflow-3pkg:apk/chainguard/airflow-core-2pkg:apk/chainguard/kubeflow-volumes-web-apppkg:apk/chainguard/mitmproxypkg:apk/chainguard/mlflowpkg:apk/chainguard/mlflow-iamguarded-compatpkg:apk/chainguard/open-webuipkg:apk/chainguard/py3.10-ambassadorpkg:apk/chainguard/py3.11-ambassadorpkg:apk/chainguard/py3.12-ambassadorpkg:apk/chainguard/py3.13-ambassadorpkg:apk/wolfi/airflow-3pkg:apk/wolfi/kubeflow-volumes-web-apppkg:apk/wolfi/mitmproxypkg:apk/wolfi/mlflowpkg:apk/wolfi/mlflow-iamguarded-compatpkg:apk/wolfi/open-webuipkg:apk/wolfi/py3.10-ambassadorpkg:apk/wolfi/py3.11-ambassadorpkg:apk/wolfi/py3.12-ambassadorpkg:apk/wolfi/py3.13-ambassadorpkg:pypi/flaskpkg:rpm/opensuse/python-Flask&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/python-Flask&distro=openSUSE%20Tumbleweedpkg:rpm/suse/python-Flask&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Python%203%2015%20SP7pkg:rpm/suse/python-Flask&distro=SUSE%20Linux%20Enterprise%20Server%2016.0pkg:rpm/suse/python-Flask&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20applications%2016.0
< 2.11.2-r5+ 27 more
- (no CPE)range: < 2.11.2-r5
- (no CPE)range: < 3.2.1-r0
- (no CPE)range: < 2.11.2-r3
- (no CPE)range: < 1.10.0-r11
- (no CPE)range: < 12.2.2-r1
- (no CPE)range: < 3.9.0-r1
- (no CPE)range: < 3.9.0-r1
- (no CPE)range: < 0.8.3-r1
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.2.1-r0
- (no CPE)range: < 1.10.0-r11
- (no CPE)range: < 12.2.2-r1
- (no CPE)range: < 3.9.0-r1
- (no CPE)range: < 3.9.0-r1
- (no CPE)range: < 0.8.3-r1
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.10.0-r20
- (no CPE)range: < 3.1.3
- (no CPE)range: < 2.3.2-150400.3.9.1
- (no CPE)range: < 3.1.3-1.1
- (no CPE)range: < 2.3.2-150400.3.9.1
- (no CPE)range: < 3.1.1-160000.3.1
- (no CPE)range: < 3.1.1-160000.3.1
Patches
Vulnerability mechanics
References
5- github.com/advisories/GHSA-68rp-wp8r-4726ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-27205ghsaADVISORY
- github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4ghsax_refsource_MISCWEB
- github.com/pallets/flask/releases/tag/3.1.3ghsax_refsource_MISCWEB
- github.com/pallets/flask/security/advisories/GHSA-68rp-wp8r-4726ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.