Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions new_pr_comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import flask

app = flask.Flask(__name__)

# ruleid: active-debug-code-flask
app.run(debug=True, use_debugger=False, use_reloader=False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The application is running debug code or has debug mode enabled. This may expose sensitive information, like stack traces and environment variables, to attackers. It may also modify application behavior, potentially enabling attackers to bypass restrictions. To remediate this finding, ensure that the application's debug code and debug mode are disabled or removed from the production environment.

Ignore this finding from active-debug-code-flask.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detected Flask app with debug=True. Do not deploy to production with this flag enabled as it will leak sensitive information. Instead, consider using Flask configuration variables or setting 'debug' using system environment variables.

Ignore this finding from debug-enabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-level app.run(...) is ignored by flask. Consider putting app.run(...) behind a guard, like inside a function

Ignore this finding from avoid_using_app_run_directly.


app.run(passthrough_errors=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-level app.run(...) is ignored by flask. Consider putting app.run(...) behind a guard, like inside a function

Ignore this finding from avoid_using_app_run_directly.


# ok: active-debug-code-flask
app.run()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-level app.run(...) is ignored by flask. Consider putting app.run(...) behind a guard, like inside a function

Ignore this finding from avoid_using_app_run_directly.


app = flask.Flask(__name__)

# ruleid: active-debug-code-flask
app.debug = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The application is running debug code or has debug mode enabled. This may expose sensitive information, like stack traces and environment variables, to attackers. It may also modify application behavior, potentially enabling attackers to bypass restrictions. To remediate this finding, ensure that the application's debug code and debug mode are disabled or removed from the production environment.

Ignore this finding from active-debug-code-flask.