fix(deps): Flask app is run in debug mode vulnerable to possible disclosure of permanent session cookie due to missing Vary: Cookie header #1751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When all of the following conditions are met, a response containing data intended for one client may be cached and subsequently sent by a 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.
SESSION_REFRESH_EACH_REQUEST is enabled (the default).
and fix the problem, we should ensure that the Flask app cannot be run in debug mode, regardless of how the
init
function is called. The best way to do this is to remove thedebug
argument from theinit
function and always run the app withdebug=False
. This change should be made in the.evergreen/ocsp/mock_ocsp_responder.py
file, specifically in theinit
function definition and the call toapp.run
. No additional imports or definitions are needed.References
CVE-2023-30861
Flask Quickstart Documentation: Debug Mode
Werkzeug Documentation: Debugging Applications