Bug 2196643 (CVE-2023-30861) - CVE-2023-30861 flask: Possible disclosure of permanent session cookie due to missing Vary: Cookie header
Summary: CVE-2023-30861 flask: Possible disclosure of permanent session cookie due to ...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2023-30861
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2196678 2196679 2196680 2196681 2196682 2196683 2196644 2196645 2196676 2196677 2203721 2203722 2203723 2203724 2254400
Blocks: 2196097
TreeView+ depends on / blocked
 
Reported: 2023-05-09 17:15 UTC by Marco Benatto
Modified: 2023-12-13 19:06 UTC (History)
25 users (show)

Fixed In Version: flask 2.2.5, flask 2.3.2
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Python Flask package. A cached response may contain data for one client sent by a proxy to other clients, including session cookies, resulting in the compromise of data confidentiality contained in the leak requests or cookies. This happens when the following conditions are met by the proxy's behavior regarding cookies and the application's behavior session usage: 1. The caching proxy does not strip or ignore response with cookies 2. The application sets a permanent session 3. The application does not access or modify the session during requests 4. SESSION_REFRESH_EACH_REQUEST is enabled, which is the default Flask behavior 5. The application does not set the Cache-Control header to avoid being cached
Clone Of:
Environment:
Last Closed: 2023-06-07 14:59:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2023:3440 0 None None None 2023-06-05 13:55:11 UTC
Red Hat Product Errata RHSA-2023:3444 0 None None None 2023-06-05 14:08:30 UTC
Red Hat Product Errata RHSA-2023:3446 0 None None None 2023-06-05 14:45:58 UTC
Red Hat Product Errata RHSA-2023:3525 0 None None None 2023-06-07 07:41:18 UTC
Red Hat Product Errata RHSA-2023:3536 0 None None None 2023-06-13 13:26:22 UTC
Red Hat Product Errata RHSA-2023:3545 0 None None None 2023-06-14 04:21:38 UTC
Red Hat Product Errata RHSA-2023:7341 0 None None None 2023-11-30 14:35:06 UTC

Description Marco Benatto 2023-05-09 17:15:36 UTC
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.

Comment 1 Marco Benatto 2023-05-09 17:16:25 UTC
Created python-flask tracking bugs for this issue:

Affects: fedora-all [bug 2196644]
Affects: openstack-rdo [bug 2196645]

Comment 3 Marco Benatto 2023-05-09 20:02:42 UTC
Created python3-flask tracking bugs for this issue:

Affects: epel-7 [bug 2196676]

Comment 8 errata-xmlrpc 2023-06-05 13:55:09 UTC
This issue has been addressed in the following products:

  Red Hat OpenStack Platform 17.0

Via RHSA-2023:3440 https://access.redhat.com/errata/RHSA-2023:3440

Comment 9 errata-xmlrpc 2023-06-05 14:08:28 UTC
This issue has been addressed in the following products:

  Red Hat OpenStack Platform 16.2

Via RHSA-2023:3444 https://access.redhat.com/errata/RHSA-2023:3444

Comment 10 errata-xmlrpc 2023-06-05 14:45:56 UTC
This issue has been addressed in the following products:

  Red Hat OpenStack Platform 16.1

Via RHSA-2023:3446 https://access.redhat.com/errata/RHSA-2023:3446

Comment 11 errata-xmlrpc 2023-06-07 07:41:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7 Extras

Via RHSA-2023:3525 https://access.redhat.com/errata/RHSA-2023:3525

Comment 12 Product Security DevOps Team 2023-06-07 14:59:38 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2023-30861

Comment 13 errata-xmlrpc 2023-06-13 13:26:20 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.13

Via RHSA-2023:3536 https://access.redhat.com/errata/RHSA-2023:3536

Comment 14 errata-xmlrpc 2023-06-14 04:21:36 UTC
This issue has been addressed in the following products:

  Red Hat OpenShift Container Platform 4.12

Via RHSA-2023:3545 https://access.redhat.com/errata/RHSA-2023:3545

Comment 15 errata-xmlrpc 2023-11-30 14:35:03 UTC
This issue has been addressed in the following products:

  Red Hat Quay 3

Via RHSA-2023:7341 https://access.redhat.com/errata/RHSA-2023:7341


Note You need to log in before you can comment on or make changes to this bug.