Django SQL Injection in cursor.execute()
CRITICALSQL injection vulnerability: User input flows to cursor.execute() without parameterization within a function. Use parameterized queries with %s placeholders.
SQL injection vulnerability: User input flows to cursor.execute() without parameterization within a function. Use parameterized queries with %s placeholders.
Experiment with the vulnerable code and security rule below. Edit the code to see how the rule detects different vulnerability patterns.
pathfinder ci --ruleset python/PYTHON-DJANGO-001 --project .Common questions about Django SQL Injection in cursor.execute()
Use Code Pathfinder to scan your Python codebase and automatically detect instances of this vulnerability pattern. Install Code Pathfinder and run the following command in your project directory:
pathfinder ci --ruleset python/PYTHON-DJANGO-001 --project .This rule is aligned with industry-standard security frameworks and classifications:
New feature
The Django SQL Injection in cursor.execute() rule runs in CI and posts inline review comments on the exact lines — no dashboard, no SARIF viewer.