VNX-1269: Product Released in Non-Release Configuration
A Python debugger hook is left in production code, so the shipped program stops at an interactive debugger prompt (hanging the worker.
| Field | Value |
|---|---|
| Rule ID | VNX-1269 |
| Severity | Low |
| SARIF level | note |
| Kind | sast |
| Languages | Python |
| CWE | CWE-1269 |
| CAPEC | CAPEC-66 |
| ATT&CK | T1190 |
| CWSS vector | CWSS:1.0/TI:L/AP:RU/AL:S/IC:N/FC:LT/RP:RU/RL:S/AV:L/AS:N/IN:A/SC:A/BI:L/DI:H/EX:L/EC:N/P:L |
| Tags | product-released-in-non-release-config debugger python cwe-1269 |
| Source | internal/sast/rules/vnx-1269.rego |
Overview
VNX-1269 maps to CWE-1269: Product Released in Non-Release Configuration.
Why this matters
A debugger hook left in shipped code stops the process at an interactive prompt. That hangs the worker, or hands a Python shell to whoever owns the terminal. A remote-debug listener (debugpy.listen, ptvsd.enable_attach) is worse: anyone who can reach the port can run arbitrary code.
What gets flagged
pdb.set_trace()
import ipdb; ipdb.set_trace()
breakpoint()
debugpy.listen(("0.0.0.0", 5678))
ptvsd.enable_attach(address=("0.0.0.0", 3000))
Not flagged: a hook inside if args.pdb: or if os.environ.get("DEBUG"):, methods of your own named set_trace or breakpoint, test files.
Remediation
- Remove the breakpoint before release, and add a lint or pre-commit check (for example ruff
T100). - Put any debugging aid that has to stay behind an explicit, off-by-default setting.
References
Suppressing this rule
Put a nosec comment on the line, or on line 1 to cover the whole file. Use the comment marker of the file’s language (#, //, -- or ;):
# nosec vnx-1269
// nosec vnx-1269
Or record an ignore rule: vulnetix ignore add --rule vnx-1269 --reason "...". See Suppressing findings.