Skip to content

CVE-2023-30861 Flask vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header

HighCVSS 7.5 EPSS 1.3%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
UbuntuDebian

Description

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.

Upgrade path

8 packages: 7 fixed.

PackageAffectedFixed inStatus
debian/flask(Debian 12) < 2.2.2-3 2.2.2-3 Fixed
debian/flask(Debian 13) < 2.2.2-3 2.2.2-3 Fixed
debian/flask(Debian 14) < 2.2.2-3 2.2.2-3 Fixed
palletsprojects flask < 2.2.5; >= 2.3.0, < 2.3.2 2.2.5, 2.3.2 Fixed
pypi flask(PyPI) < 2.2.5; = 0.1; = 0.2; = 0.3 +51 more 2.2.5, 2.3.2 Fixed
ubuntu/flask(Ubuntu 20.04) < 1.1.1-2ubuntu0.1; = 1.0.2-3; = 1.1.1-2 1.1.1-2ubuntu0.1 Fixed
ubuntu/flask(Ubuntu 22.04) < 2.0.1-2ubuntu1.1; = 1.1.2-2; = 2.0.1-2ubuntu1 2.0.1-2ubuntu1.1 Fixed
pallets flask = < 2.2.5; = >= 2.3.0, < 2.3.2 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi flask(PyPI) >= 2.3.0, < 2.3.2 2.3.2
pypi flask(PyPI) = 2.3.0 No fix listed
pypi flask(PyPI) = 2.3.1 No fix listed
pypi flask(PyPI) < 2.2.5 2.2.5
pypi flask(PyPI) = 0.1 No fix listed
pypi flask(PyPI) = 0.10 No fix listed
pypi flask(PyPI) = 0.10.1 No fix listed
pypi flask(PyPI) = 0.11 No fix listed
pypi flask(PyPI) = 0.11.1 No fix listed
pypi flask(PyPI) = 0.12 No fix listed
pypi flask(PyPI) = 0.12.1 No fix listed
pypi flask(PyPI) = 0.12.2 No fix listed
pypi flask(PyPI) = 0.12.3 No fix listed
pypi flask(PyPI) = 0.12.4 No fix listed
pypi flask(PyPI) = 0.12.5 No fix listed
pypi flask(PyPI) = 0.2 No fix listed
pypi flask(PyPI) = 0.3 No fix listed
pypi flask(PyPI) = 0.3.1 No fix listed
pypi flask(PyPI) = 0.4 No fix listed
pypi flask(PyPI) = 0.5 No fix listed
pypi flask(PyPI) = 0.5.1 No fix listed
pypi flask(PyPI) = 0.5.2 No fix listed
pypi flask(PyPI) = 0.6 No fix listed
pypi flask(PyPI) = 0.6.1 No fix listed
pypi flask(PyPI) = 0.7 No fix listed
Show 43 more
ProductAffected versionsFixed in
pypi flask(PyPI) = 0.7.1 No fix listed
pypi flask(PyPI) = 0.7.2 No fix listed
pypi flask(PyPI) = 0.8 No fix listed
pypi flask(PyPI) = 0.8.1 No fix listed
pypi flask(PyPI) = 0.9 No fix listed
pypi flask(PyPI) = 1.0 No fix listed
pypi flask(PyPI) = 1.0.1 No fix listed
pypi flask(PyPI) = 1.0.2 No fix listed
pypi flask(PyPI) = 1.0.3 No fix listed
pypi flask(PyPI) = 1.0.4 No fix listed
pypi flask(PyPI) = 1.1.0 No fix listed
pypi flask(PyPI) = 1.1.1 No fix listed
pypi flask(PyPI) = 1.1.2 No fix listed
pypi flask(PyPI) = 1.1.3 No fix listed
pypi flask(PyPI) = 1.1.4 No fix listed
pypi flask(PyPI) = 2.0.0 No fix listed
pypi flask(PyPI) = 2.0.0rc1 No fix listed
pypi flask(PyPI) = 2.0.0rc2 No fix listed
pypi flask(PyPI) = 2.0.1 No fix listed
pypi flask(PyPI) = 2.0.2 No fix listed
pypi flask(PyPI) = 2.0.3 No fix listed
pypi flask(PyPI) = 2.1.0 No fix listed
pypi flask(PyPI) = 2.1.1 No fix listed
pypi flask(PyPI) = 2.1.2 No fix listed
pypi flask(PyPI) = 2.1.3 No fix listed
pypi flask(PyPI) = 2.2.0 No fix listed
pypi flask(PyPI) = 2.2.1 No fix listed
pypi flask(PyPI) = 2.2.2 No fix listed
pypi flask(PyPI) = 2.2.3 No fix listed
pypi flask(PyPI) = 2.2.4 No fix listed
debian/flask(Debian:12) < 2.2.2-3 2.2.2-3
debian/flask(Debian:13) < 2.2.2-3 2.2.2-3
debian/flask(Debian:14) < 2.2.2-3 2.2.2-3
pallets flask = >= 2.3.0, < 2.3.2 No fix listed
pallets flask = < 2.2.5 No fix listed
ubuntu/flask(Ubuntu:22.04) < 2.0.1-2ubuntu1.1 2.0.1-2ubuntu1.1
palletsprojects flask < 2.2.5 2.2.5
palletsprojects flask >= 2.3.0, < 2.3.2 2.3.2
ubuntu/flask(Ubuntu:20.04) < 1.1.1-2ubuntu0.1 1.1.1-2ubuntu0.1
ubuntu/flask(Ubuntu:20.04) = 1.0.2-3 No fix listed
ubuntu/flask(Ubuntu:20.04) = 1.1.1-2 No fix listed
ubuntu/flask(Ubuntu:22.04) = 1.1.2-2 No fix listed
ubuntu/flask(Ubuntu:22.04) = 2.0.1-2ubuntu1 No fix listed

References