Security Resilience

CVE-2023-30861

Palletsprojects Flask ≤ 2.2.5

Published
02 May 2023
Modified
21 November 2024
Patch / advisory
CVSS Score v3.1 7.5
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS Score 0.013 70th percentile
Risk Priority 60 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2023-30861 is a high-severity Use of Persistent Cookies Containing Sensitive Information (CWE-539) vulnerability in Palletsprojects Flask. Its CVSS base score is 7.5 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Steal Web Session Cookie (T1539); ranked in the top 30% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1539 Steal Web Session Cookie Credential Access
An adversary may steal web application or service session cookies and use them to gain access to web applications or Internet services as an authenticated user without needing credentials.
T1589.001 Credentials Reconnaissance
Adversaries may gather credentials that can be used during targeting.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-27205Same product: Palletsprojects Flask
CVE-2024-39275Shared CWE-539
CVE-2025-52633Shared CWE-539
CVE-2026-24318Shared CWE-539
CVE-2025-27673Shared CWE-539
CVE-2026-35192Shared CWE-539
CVE-2024-22195Same vendor: Palletsprojects
CVE-2023-25577Same vendor: Palletsprojects
CVE-2024-56326Same vendor: Palletsprojects
CVE-2023-23934Same vendor: Palletsprojects

Affected Assets

palletsprojects
flask
≤ 2.2.5 · 2.3.0 — 2.3.2

Mitigating Controls

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 full match
blocks

Secure SDLC practices and coding standards directly prohibit storing sensitive data in persistent cookies.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing can detect and prevent use of persistent cookies with sensitive data.

blocks

A.8.1's storage device encryption (h), access controls (g), and malware protection (i) block some exploitation paths — physical theft of the device yielding direct cookie file access, and on-device malware reading the cookie jar — but the weakness is a web application design defect, and the main exploitation paths (XSS reading document.cookie, network interception, browser extensions) are not addressed by endpoint device controls.

A.8.11 Data masking partial match
removes

Data masking applied to cookie contents (encryption, hashing, substitution) removes the 'containing sensitive information' half of the weakness, but the persistence aspect of CWE-539 is untouched and the clause is a general data-masking policy that does not specifically mandate cookie coverage, so only a minority of instances are fully removed.

blocks

A.8.24 well implemented establishes that sensitive information be protected by cryptography, which when applied to cookie contents would block the exploitation (reading the cookie file yields ciphertext); however, the clause does not specifically mandate cookie encryption, and the application to cookies is a design choice, leaving a nameable remainder of instances where sensitive cookie data is not encrypted under the policy.

prevents

Secure coding standards directly forbid embedding sensitive information in persistent cookies.

prevents

A.8.30 carries its effect through the secure-development practices its contract requires of the supplier (8.25–8.29), which include secure design and coding guidance that reaches cookie handling; the clause has a declared ceiling of `partial` on this verb for software weaknesses, and CWE-539 is a design/implementation defect in first-party web code that those practices address only as a slice.

References