Flask vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Partial Red Hat: 8 fixed, 3 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.
Summary
Flask is a lightweight WSGI web application framework. When all of the following conditions are met, a response containing data intended for one client may be cached and subsequently sent by the proxy to other clients. If the proxy also caches `Set-Cookie` headers, it may send one client's `session` cookie to other clients. The severity depends on the application's use of the session and the proxy'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 strip cookies or ignore responses with cookies. 2. The application sets `session.permanent = True` 3. The application does not access or modify the session at any point during a request. 4. `SESSION_REFRESH_EACH_REQUEST` enabled (the default). 5. The application does not set a `Cache-Control` header to indicate that a page is private or should not be cached. This happens because vulnerable versions of Flask only set the `Vary: Cookie` header when the session is accessed or modified, not when it is refreshed (re-sent to update the expiration) without being accessed or modified. This issue has been fixed in versions 2.3.2 and 2.2.5.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pallets | flask | 2.3.0 to before 2.3.2; before 2.2.5 | 2.3.2, 2.2.5 | Patch available | CNA |
| — | Flask (PyPI) | 2.3.0 to before 2.3.2 | 2.3.2 | Patch available | GHSA-m2qf-hxjv-5gpq |
| — | Flask (PyPI) | before 2.2.5 | 2.2.5 | Patch available | GHSA-m2qf-hxjv-5gpq |
- flask Vendorpallets Affected 2.3.0 to before 2.3.2; before 2.2.5 Fixed in 2.3.2, 2.2.5 Patch available CNA
- Flask (PyPI) Vendor— Affected 2.3.0 to before 2.3.2 Fixed in 2.3.2 Patch available GHSA-m2qf-hxjv-5gpq
- Flask (PyPI) Vendor— Affected before 2.2.5 Fixed in 2.2.5 Patch available GHSA-m2qf-hxjv-5gpq
Remediation
- Fix · CNA flask (pallets) Fixed in 2.3.2, 2.2.5
- Fix · GHSA-m2qf-hxjv-5gpq Flask (PyPI) Fixed in 2.3.2 Advisory →
- Fix · GHSA-m2qf-hxjv-5gpq Flask (PyPI) Fixed in 2.2.5 Advisory →
Red Hat 8 advisories
- RHSA-2023:7341 Released 2023-11-30 · Red Hat rating ImportantRed Hat Quay security update
- Quay v3 quay/quay-rhel8
- RHSA-2023:3541 Released 2023-06-14 · Red Hat rating LowOpenShift Container Platform 4.11.43 packages and security update
- Ironic content for Red Hat OpenShift Container Platform 4.11 python-flask-1:1.1.2-6.el8, python-flask-doc-1:1.1.2-6.el8, python3-flask-1:1.1.2-6.el8
- Red Hat OpenShift Container Platform 4.11 cri-o-1.24.5-5.rhaos4.11.git8bf967b.el8
- RHSA-2023:3545 Released 2023-06-14 · Red Hat rating ImportantOpenShift Container Platform 4.12.21 packages and security update
- Ironic content for Red Hat OpenShift Container Platform 4.12 python-flask-1:2.0.1-3.el9, python-flask-doc-1:2.0.1-3.el9, python3-flask-1:2.0.1-3.el9
- Red Hat OpenShift Container Platform 4.12 podman-3:4.2.0-4.1.rhaos4.12.el8, podman-catatonit-3:4.2.0-4.1.rhaos4.12.el8, podman-docker-3:4.2.0-4.1.rhaos4.12.el8 +4
Show 5 more Red Hat advisories
- RHSA-2023:3536 Released 2023-06-13 · Red Hat rating ImportantOpenShift Container Platform 4.13.3 packages and security update
- Ironic content for Red Hat OpenShift Container Platform 4.13 python-flask-2:2.0.1-4.el9.2, python-flask-doc-2:2.0.1-4.el9.2, python3-flask-2:2.0.1-4.el9.2
- Red Hat OpenShift Container Platform 4.13 NetworkManager-1:1.42.2-2.el9_2, NetworkManager-adsl-1:1.42.2-2.el9_2, NetworkManager-bluetooth-1:1.42.2-2.el9_2 +28
- RHSA-2023:3525 Released 2023-06-07 · Red Hat rating Importantpython-flask security update
- Red Hat Enterprise Linux 7 Extras python-flask-1:0.10.1-7.el7_9
- RHSA-2023:3440 Released 2023-06-05 · Red Hat rating ImportantRed Hat OpenStack Platform 17.0 (python-flask) security update
- Red Hat OpenStack Platform 17.0 python-flask-1:1.1.2-6.el9ost, python3-flask-1:1.1.2-6.el9ost
- RHSA-2023:3446 Released 2023-06-05 · Red Hat rating ImportantRed Hat OpenStack Platform 16.1 (python-flask) security update
- Red Hat OpenStack Platform 16.1 python-flask-1:1.0.2-8.el8ost, python3-flask-1:1.0.2-8.el8ost
- RHSA-2023:3444 Released 2023-06-05 · Red Hat rating ImportantRed Hat OpenStack Platform 16.2 (python-flask) security update
- Red Hat OpenStack Platform 16.2 python-flask-1:1.0.2-8.el8ost, python3-flask-1:1.0.2-8.el8ost
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ceph Storage 3 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 8 | Affected | No fix yet |
| Red Hat Storage 3 | Affected | No fix yet |
| Ironic content for Red Hat OpenShift Container Platform 4.11 | Fixed | RHSA-2023:3541 |
| Ironic content for Red Hat OpenShift Container Platform 4.12 | Fixed | RHSA-2023:3545 |
| Ironic content for Red Hat OpenShift Container Platform 4.13 | Fixed | RHSA-2023:3536 |
| Quay v3 | Fixed | RHSA-2023:7341 |
| Red Hat Enterprise Linux 7 Extras | Fixed | RHSA-2023:3525 |
| Red Hat OpenStack Platform 16.1 | Fixed | RHSA-2023:3446 |
| Red Hat OpenStack Platform 16.2 | Fixed | RHSA-2023:3444 |
| Red Hat OpenStack Platform 17.0 | Fixed | RHSA-2023:3440 |
Not affected: 6 products
- Ironic content for Red Hat OpenShift Container Platform 4.11
- Quay v3
- Red Hat Ceph Storage 7
- Red Hat OpenShift Container Platform 4.11
- Red Hat OpenShift Container Platform 4.12
- Red Hat OpenShift Container Platform 4.13
Timeline
- 2026-10-02 Threatist record created from CVE-2023-30861
- 2026-10-03 Alias added: GHSA-m2qf-hxjv-5gpq
References
Patch 2
Advisory 2
Other 8
- https://github.com/pallets/flask/releases/tag/2.2.5
- https://github.com/pallets/flask/releases/tag/2.3.2
- https://www.debian.org/security/2023/dsa-5442
- https://security.netapp.com/advisory/ntap-20230818-0006/
- https://lists.debian.org/debian-lts-announce/2023/08/msg00024.html
- https://github.com/pallets/flask
- https://github.com/pypa/advisory-database/tree/main/vulns/flask/PYSEC-2023-62.yaml
- https://security.netapp.com/advisory/ntap-20230818-0006
More pallets Flask vulnerabilities
- TI-2018-16009 The Pallets Project flask version Before 0.12.3 contains a CWE-20: Improper Input… CVSS 3.0HIGH 7.5
- TI-2019-15971 Uncontrolled resource consumption in Pallets Project Flask CVSS 3.0HIGH 7.5
- TI-2026-21640 Flask session does not add `Vary: Cookie` header when accessed in some ways CVSS 4.0LOW 2.3
Sources
- CVE-2023-30861 · CVE Program
- CVE-2023-30861 · NVD
- FIRST EPSS
- GHSA-m2qf-hxjv-5gpq · GitHub Advisory Database · CC BY 4.0
- CVE-2023-30861 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences