CVE-2023-30861: Flask permanent session cookie disclosure through shared caching
- Vendor
- Palletsprojects
CVE-2023-30861 is an information disclosure vulnerability in Flask's session refresh handling. Vulnerable releases set the Vary: Cookie response header when a session is accessed or modified, but omit it when a permanent session is refreshed without being accessed or modified. Under specific application and proxy configurations, a shared caching proxy can consequently serve a response intended for one client to another. If the proxy also caches and replays Set-Cookie headers, it can disclose the first client's session cookie. The issue is fixed in Flask 2.2.5 and 2.3.2.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Cross-client disclosure of cached response data and, when Set-Cookie headers are cached, permanent session cookies. A disclosed cookie may permit session impersonation or unauthorized access to session-associated data, depending on how the application uses sessions. Severity depends on application behavior and the proxy's handling of cookies; arbitrary code execution and availability impacts are not established.
Mitigation
If you can’t patch tonight, do this now.
Until patched, prevent shared caching of session-bearing or personalized responses by setting Cache-Control: private or no-store and configuring upstream proxies not to cache such responses, including responses containing Set-Cookie. Where application requirements permit, avoid permanent sessions or disable SESSION_REFRESH_EACH_REQUEST. Suppressing cached Set-Cookie headers alone does not prevent disclosure of a cached response body.
Remediation
Patch, then assume compromise.
Upgrade Flask to a fixed release: 2.2.5 for the 2.2.x branch, 2.3.2 for the 2.3.x branch, or a later supported release containing the fix. For vendor-managed deployments, install the corresponding vendor security updates. OpenShift Container Platform fixes were included in releases 4.12.21 and 4.13.3.
Exploits
1 exploit validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2023-30861 exploited in the wild?
- As of Nov 18, 2026, Mallory has no reports of CVE-2023-30861 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2023-30861?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2023-30861, the earliest disclosed Apr 25, 2025.
- Is there a patch for CVE-2023-30861?
- Upgrade Flask to a fixed release: 2.2.5 for the 2.2.x branch, 2.3.2 for the 2.3.x branch, or a later supported release containing the fix. For vendor-managed deployments, install the corresponding vendor security updates.
- What products are affected by CVE-2023-30861?
- Palletsprojects Flask.
- How severe is CVE-2023-30861?
- CVE-2023-30861 has a CVSS v3.1 score of 7.5 (High) and an EPSS score of 1.3% (70th percentile) as of Nov 18, 2026.
Recent activity
3 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.