Click to see the query in the CodeQL repository
Running a Flask application with debug mode enabled may allow an attacker to gain access through the Werkzeug debugger.
Ensure that Flask applications that are run in a production environment have debugging disabled.
Running the following code starts a Flask webserver that has debugging enabled. By visiting /crash, it is possible to gain access to the debugger, and run arbitrary code through the interactive debugger.
Flask Quickstart Documentation: Debug Mode.
Werkzeug Documentation: Debugging Applications.
Common Weakness Enumeration: CWE-215.
Common Weakness Enumeration: CWE-489.