CVE-2023-30861 Flask vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header
- 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.
- The application must be hosted behind a caching proxy that does not strip cookies or ignore responses with cookies.
- The application sets
session.permanent = True - The application does not access or modify the session at any point during a request.
SESSION_REFRESH_EACH_REQUESTenabled (the default).- The application does not set a
Cache-Controlheader 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.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| 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
| Product | Affected versions | Fixed 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
| Product | Affected versions | Fixed 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
- https://github.com/pallets/flask/security/advisories/GHSA-m2qf-hxjv-5gpq issue-tracking vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/pallets/flask/commit/70f906c51ce49c485f1d355703e9cc3386b1cc2b issue-tracking patch
- https://github.com/pallets/flask/commit/afd63b16170b7c047f5758eb910c416511e9c965 issue-tracking patch
- github.com product
- https://github.com/pallets/flask/releases/tag/2.2.5 issue-tracking release-notes
- https://github.com/pallets/flask/releases/tag/2.3.2 issue-tracking release-notes
- github.com
- lists.debian.org
- security.netapp.com
- www.debian.org
- github.com
- Debian Security Tracker CVE-2023-30861 vendor-advisory
- Ubuntu CVE tracker issue-tracking vendor-advisory
- USN-6111-1 vendor-advisory
- www.cve.org issue-tracking
- bugs.debian.org issue-tracking
- github.com issue-tracking
- github.com issue-tracking