# Flask Debug Mode in Production - ID: flask-debug-mode-production - Severity: HIGH - CWE: CWE-489 (CWE-489) - Languages: Python - Frameworks: flask ## Description Detects Flask applications running with debug mode enabled. Debug mode exposes sensitive information, allows code execution through the interactive debugger, and should NEVER be enabled in production. ## Remediation Load debug mode from environment variables, defaulting to False. ```python import os from flask import Flask app = Flask(__name__) if __name__ == '__main__': debug = os.getenv('FLASK_DEBUG', 'False').lower() == 'true' app.run(debug=debug) ``` Learn more: https://shoulder.dev/learn/python/cwe-489/debug-mode ## Documentation [object Object] ## Related Rules - **Django Debug Mode in Production** [CRITICAL]: - **Echo Debug Mode in Production** [MEDIUM]: - **Fiber Debug Mode in Production** [MEDIUM]: - **Gin Debug Mode in Production** [MEDIUM]: - **Debug Mode Enabled in Production** [MEDIUM]: