CVE-2023-30861Palletsprojects Flask
High 7.5 No auth needed
Follow: this CVE · Palletsprojects · Palletsprojects Flask We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 1.3% probability of exploitation in 30 days · percentile 71
- Auth required
- No
- Published
- May 2, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-539
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
What happens
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.
What to do
- Apply the vendor's security update for Flask.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | flask |
≥ 2.3.0 < 2.3.2 |
2.3.2 |
pip install "flask>=2.3.2" |
| PyPI | flask |
< 2.2.5 |
2.2.5 |
pip install "flask>=2.2.5" |
| PyPI | flask |
< 2.2.5 |
2.2.5 |
pip install "flask>=2.2.5" |
| PyPI | flask |
≥ 2.3.0 < 2.3.2 |
2.3.2 |
pip install "flask>=2.3.2" |
Per OSV / GitHub Advisories (GHSA-m2qf-hxjv-5gpq, PYSEC-2023-62). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| palletsprojects | flask | < 2.2.5 |
| palletsprojects | flask | ≥ 2.3.0 < 2.3.2 |
Official advisories
- python313-Flask-3.1.3-3.1 on GA media · SUSE · openSUSE-SU-2026:11902-1 · Sep 28, 2026 High
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Patch
- github.com Release Notes
- github.com Release Notes
- github.com Vendor Advisory
- lists.debian.org
- security.netapp.com
- www.debian.org