mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Python: Move query tests to reflect new file layout
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
| test.py:10:1:10:19 | ControlFlowNode for Attribute() | A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger. |
|
||||
| test.py:25:1:25:20 | ControlFlowNode for Attribute() | A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger. |
|
||||
| test.py:29:1:29:20 | ControlFlowNode for Attribute() | A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger. |
|
||||
| test.py:37:1:37:18 | ControlFlowNode for runapp() | A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger. |
|
||||
@@ -1 +0,0 @@
|
||||
Security/BadPractice/FlaskRunWithDebug/FlaskDebug.ql
|
||||
@@ -1 +0,0 @@
|
||||
semmle-extractor-options: --max-import-depth=2 -p ../lib
|
||||
@@ -1,37 +0,0 @@
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/crash')
|
||||
def main():
|
||||
raise Exception()
|
||||
|
||||
# bad
|
||||
app.run(debug=True)
|
||||
|
||||
# okay
|
||||
app.run()
|
||||
app.run(debug=False)
|
||||
|
||||
# also okay
|
||||
run(debug=True)
|
||||
|
||||
app.notrun(debug=True)
|
||||
|
||||
# a slightly more involved example using flow and truthy values
|
||||
|
||||
DEBUG = True
|
||||
|
||||
app.run(debug=DEBUG)
|
||||
|
||||
DEBUG = 1
|
||||
|
||||
app.run(debug=DEBUG)
|
||||
|
||||
if False:
|
||||
app.run(debug=True)
|
||||
|
||||
|
||||
|
||||
runapp = app.run
|
||||
runapp(debug=True)
|
||||
Reference in New Issue
Block a user