Skip to content

fix: disable Flask debug mode in getting-started example (CWE-489) - #392

Merged
britaniar merged 1 commit into
Azure:mainfrom
britaniar:fix-cwe-489-flask-debug
Jul 30, 2026
Merged

fix: disable Flask debug mode in getting-started example (CWE-489)#392
britaniar merged 1 commit into
Azure:mainfrom
britaniar:fix-cwe-489-flask-debug

Conversation

@britaniar

Copy link
Copy Markdown
Contributor

Summary

Fixes CWE-489 (Active Debug Code): the Flask getting-started example app was started with debug=True, enabling the Werkzeug interactive debugger. Since the example is deployed behind a LoadBalancer Service bound to 0.0.0.0, this exposes the debugger console (and detailed error pages) to anonymous internet clients if deployed as documented, allowing potential remote code execution via Werkzeug PIN bypass.

Change

Removed debug=True from app.run(...) in examples/getting-started/app/main.py.

Fixes

Fixes #390

The example app was started with debug=True, which enables the
Werkzeug interactive debugger. Since the example is deployed behind a
LoadBalancer Service bound to 0.0.0.0, this would expose the debugger
console (and detailed error pages) to anonymous internet clients,
allowing potential remote code execution via PIN bypass.

Fixes Azure#390

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.06%. Comparing base (9b87563) to head (a44200b).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #392   +/-   ##
=======================================
  Coverage   67.06%   67.06%           
=======================================
  Files          33       33           
  Lines        3783     3783           
=======================================
  Hits         2537     2537           
  Misses       1072     1072           
  Partials      174      174           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@britaniar
britaniar merged commit 996ac98 into Azure:main Jul 30, 2026
10 checks passed
@britaniar
britaniar deleted the fix-cwe-489-flask-debug branch July 30, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CWE-489: Flask getting-started example runs with debug=True exposed via LoadBalancer

2 participants