CVE-2023-30861
Palletsprojects Flask ≤ 2.2.5
Raw vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NCVSS 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
- 🇪🇺 ENISA EUVD: EUVD-2023-0080
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
CVEs Like This One
Affected Assets
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.
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.
Security testing can detect and prevent use of persistent cookies with sensitive data.
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.
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.
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.
Secure coding standards directly forbid embedding sensitive information in persistent cookies.
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.