1
Mistake 1 / 5
eval() on any external input
One of the most dangerous Python anti-patterns. Any string that reaches eval() gets executed as Python code. Attackers can import os, delete files, open reverse shells.
# Never do this
result = eval(user_input)
# Use ast.literal_eval for safe parsing
import ast
result = ast.literal_eval(user_input)
# Only handles literals: strings, ints, dicts, lists
✗ eval() = remote code execution waiting to happen