A call stops the program in a debugger
What it finds
breakpoint(), pdb.set_trace(): a call that stops the program in a debugger was left in the code. Where no one is at the terminal, the program hangs; where someone is, they get a prompt that runs any code (CWE-489).
From the rule's source, debugger_call.rs.
import pdbimport ipdb as debugger def work(x): breakpoint()tx0 reports: breakpoint stops the program in a debugger pdb.set_trace()tx0 reports: pdb.set_trace stops debugger.set_trace()tx0 reports: ipdb.set_trace stops return x class Runner: def set_trace(self): self.set_trace() Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:debugger-call" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:debugger-call] reason="..."tx0 explain tx0/python:debugger-call shows the same in the terminal. Found a false positive? Report it.