---
title: "WEB-PY-004 Python Interactive Debugger Enabled in a Service"
canonical: https://openvapt.com/checks/WEB-PY-004.html
html: https://openvapt.com/checks/WEB-PY-004.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# WEB-PY-004 Python Interactive Debugger Enabled in a Service

Checks whether a service runs Flask or Werkzeug with the interactive debugger enabled.

- Domain: Web Apps
- Severity: Critical
- Control category: Secure Configuration
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- CIS Controls v8: 16.7
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-489, CWE-94
- OWASP Top 10 2021: A05:2021
- OWASP ASVS 4.0.3: 14.3.2
- NIST SP 800-53 Rev. 5: CM-7, CM-6

## Why It Matters

The Werkzeug debugger lets a visitor run Python code from an error page. Its PIN has been bypassed and brute-forced in practice, and with WERKZEUG_DEBUG_PIN=off there is no protection at all: this is remote code execution.

## How It Detects

Reads ExecStart= and Environment= of long-running services and flags FLASK_DEBUG=1, FLASK_ENV=development, flask run --debug and WERKZEUG_DEBUG_PIN=off.

## How to Fix

Remove the debug switches, run the application under a production WSGI server (Gunicorn, uWSGI or mod_wsgi) behind nginx or Apache, run systemctl daemon-reload and restart the service.

## How to Verify

```
systemctl show -p ExecStart,Environment <unit>  shows no debug switches.
```

## Learn the Theory

- [P13 Application Servers: Tomcat, Node.js and Python](https://openvapt.com/academy/p13.md)

## References

- [Werkzeug documentation, Debugging Applications](https://werkzeug.palletsprojects.com/en/stable/debug/)
- [Flask documentation, Debug mode](https://flask.palletsprojects.com/en/stable/quickstart/#debug-mode)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/web/runtimes.go

Run it: `openvapt scan --only WEB-PY-004`. Read it offline: `openvapt explain WEB-PY-004`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/WEB-PY-004.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
