Component: Flask ML API / DevOps
Files Affected: backend/api.py, run-dev.ps1
Severity: Critical
Description
The Python Flask API relies on app.run(host="0.0.0.0", port=FLASK_PORT, debug=True) to start the server.
- Debug Mode: Leaving
debug=True exposed to a network is a severe vulnerability. The Werkzeug debugger allows arbitrary Python code execution if an attacker triggers a stack trace.
- Built-in Server: The built-in Flask server is synchronous and meant strictly for local development. It cannot handle concurrent production load efficiently.
Proposed Fix
- Remove
debug=True from app.run().
- Introduce a production-grade WSGI server (such as
gunicorn or waitress) into the Python requirements and modify the startup scripts (run-dev.ps1 or Dockerfiles) to run the app through the WSGI server instead of directly invoking api.py.
Component: Flask ML API / DevOps
Files Affected:
backend/api.py,run-dev.ps1Severity: Critical
Description
The Python Flask API relies on
app.run(host="0.0.0.0", port=FLASK_PORT, debug=True)to start the server.debug=Trueexposed to a network is a severe vulnerability. The Werkzeug debugger allows arbitrary Python code execution if an attacker triggers a stack trace.Proposed Fix
debug=Truefromapp.run().gunicornorwaitress) into the Python requirements and modify the startup scripts (run-dev.ps1or Dockerfiles) to run the app through the WSGI server instead of directly invokingapi.py.