Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pallets | flask | >= 2.3.0, < 2.3.2, < 2.2.5 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | flask | 2.2.2-3 | — |
| Debian 13 | flask | 2.2.2-3 | — |
| Debian 12 | flask | 2.2.2-3 | — |
| Debian 11 | flask | 1.1.2-2+deb11u1 | DSA-5442-1 |
| Debian 10 | flask | 1.0.2-3+deb10u1 | DLA-3536-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | flask | 2.0.1-2ubuntu1.1 | USN-6111-1 |
| Ubuntu 20.04 LTS | flask | 1.1.1-2ubuntu0.1 | USN-6111-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Rhel Extras Other 7 | python-flask | 1:0.10.1-7.el7_9 | RHSA-2023:3525 |
| Red Hat Openshift Ironic 4 | python-flask +2 | 1:1.1.2-6.el8 | RHSA-2023:3545, RHSA-2023:3541, RHSA-2023:3536 |
| Red Hat OpenStack 17 | python-flask +1 | 1:1.1.2-6.el9ost | RHSA-2023:3440 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat OpenStack 16 | python-flask +1 | 1:1.0.2-8.el8ost | RHSA-2023:3446, RHSA-2023:3444 |
| Red Hat OpenShift 4 | NetworkManager +15 | 1:1.42.2-2.el9_2 | RHSA-2023:3536 |
| Red Hat OpenShift 4 | conmon | 3:2.1.7-1.1.rhaos4.13.el9 | RHSA-2023:3536 |
| Red Hat OpenShift 4 | cri-o | 1.24.5-5.rhaos4.11.git8bf967b.el8 | RHSA-2023:3541, RHSA-2023:3536 |
| Red Hat OpenShift 4 | openshift +1 | 4.13.0-202305312300.p0.g7a891f0.assembly.stream.el8 | RHSA-2023:3536 |
| Red Hat OpenShift 4 | openshift-ansible +1 | 4.13.0-202305301841.p0.g148be47.assembly.stream.el8 | RHSA-2023:3536 |
| Red Hat OpenShift 4 | openshift-clients +1 | 4.13.0-202305312300.p0.g05d83ef.assembly.stream.el8 | RHSA-2023:3536 |
| Red Hat OpenShift 4 | podman +6 | 3:4.2.0-4.1.rhaos4.12.el8 | RHSA-2023:3545 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP5 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1, SUSE-SU-2023:2263-1 |
| SLES 15 SP4 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1, SUSE-SU-2023:2263-1 |
| SLES 15 SP3 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLES 15 SP2 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLES 15 SP1 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
Show 11 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 15 SP3 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLES for SAP 15 SP2 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLES for SAP 15 SP1 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLE Real Time 15 SP3 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLE HPC 15 SP3 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLE HPC 15 SP2 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SLE HPC 15 SP1 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SUSE Manager Server 4.2 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SUSE Manager Proxy 4.2 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SUSE Enterprise Storage 7.1 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
| SUSE Enterprise Storage 7 | python-Flask | 1.0.2-150100.6.3.1 | SUSE-SU-2023:2264-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-Flask | 3.1.3-3.1 | openSUSE-SU-2026:11902-1 |
| openSUSE Leap 15.5 | python-Flask | 1.0.4-150400.3.3.1 | SUSE-SU-2023:2263-2 |
| openSUSE Leap 15.4 | python-Flask | 1.0.4-150400.3.3.1 | SUSE-SU-2023:2263-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | python3-flask +1 | 1:1.1.2-5.amzn2023.0.3 | ALAS2023-2023-183 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-flask | No fix yet | — |
| Azure Linux 2 (CBL-Mariner) | python-flask | No fix yet | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 8 | python3-flask | 1:0.12.2-4.0.1.el8 | ELSA-2023-12710 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 2 repositories
-
elisapresciutti/CVE-2023-30861-flask-lab ★ 0 · Nov 1, 2026
Educational Docker lab reproducing CVE-2023-30861 (Flask session cookie disclosure via missing Vary: Cookie), with exploit, patch verification and a full write-up
-
fromitive/cve-2023-30861-poc ★ 0 · Apr 25, 2025
Flask CVE-2023-30861 Poc 환경구축
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | flask | >= 2.3.0, < 2.3.2 | 2.3.2 | GHSA-m2qf-hxjv-5gpq |
| PyPI | flask | < 2.2.5 | 2.2.5 | GHSA-m2qf-hxjv-5gpq |
| PyPI | flask | < 2.2.5 · >= 2.3.0, < 2.3.2 | 2.2.5, 2.3.2 | PYSEC-2023-62 |
Advisories 21
- RHSA-2023:3545 Red Hat Security Advisory: OpenShift Container Platform 4.12.21 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2023:3536 Red Hat Security Advisory: OpenShift Container Platform 4.13.3 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- openSUSE-SU-2026:11902-1 python313-Flask-3.1.3-3.1 on GA media SUSE / openSUSE Security Updates · Sep 29, 2026
- RHSA-2023:3541 Red Hat Security Advisory: OpenShift Container Platform 4.11.43 packages and security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- RHSA-2023:3525 Red Hat Security Advisory: python-flask security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- RHSA-2023:3446 Red Hat Security Advisory: Red Hat OpenStack Platform 16.1 (python-flask) security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- RHSA-2023:3444 Red Hat Security Advisory: Red Hat OpenStack Platform 16.2 (python-flask) security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- RHSA-2023:3440 Red Hat Security Advisory: Red Hat OpenStack Platform 17.0 (python-flask) security update Red Hat Security Advisories (RHSA) · Jul 3, 2026
- DSA-5442-1 flask - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3536-1 flask - security update Debian Security (DSA / DLA) · Mar 9, 2026
- USN-6111-1 flask vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
- SUSE-SU-2023:2264-1 Security update for python-Flask SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2263-2 Security update for python-Flask SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2263-1 Security update for python-Flask SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2023-1497 IBM Spectrum Protect: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jun 23, 2025
- WID-SEC-2024-0106 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jan 16, 2024
- WID-SEC-2023-1373 Red Hat OpenStack Platform : Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 30, 2023
- WID-SEC-2023-2679 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 17, 2023
- ELSA-2023-12710 Important: python-flask security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · Aug 6, 2023
- WID-SEC-2023-1812 Oracle Communications: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jul 20, 2023
- ALAS2023-2023-183 Important: python-flask security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Jun 7, 2023
References
- https://github.com/pallets/flask/security/advisories/GHSA-m2qf-hxjv-5gpq
- https://github.com/pallets/flask/commit/70f906c51ce49c485f1d355703e9cc3386b1cc2b
- https://github.com/pallets/flask/commit/afd63b16170b7c047f5758eb910c416511e9c965
- 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