This tool scans Python files for security vulnerabilities based on the OWASP Top 10.
It is designed for lightweight static analysis of pull requests, helping developers catch common issues early and enforce secure coding practices.
The scanner detects vulnerabilities using static analysis (regex + simple heuristics).
It groups results by OWASP Top 10 category and highlights severity with colour-coded output.
Implemented rules:
-
A01:2021 β Broken Access Control
- Detects Flask routes without authentication decorators
-
A02:2021 β Cryptographic Failures
- Detects weak hashing algorithms (MD5, SHA1)
- Flags hardcoded secrets, API keys, and default passwords
- Warns about unsafe fallback values
-
A03:2021 β Injection
- Detects unparameterized SQL queries
- Flags SQL built with string concatenation or f-strings
-
A04:2021 β Insecure Design
- Flags insecure βTODOβ markers, temporary overrides, or auth bypass notes
-
A05:2021 β Security Misconfiguration
- Detects
debug=Truein Flask apps - Flags permissive host settings (
ALLOWED_HOSTS = ['*']) - Insecure cookie/CSRF flags
- Hardcoded Flask secrets
- Detects
-
A06:2021 β Vulnerable and Outdated Components
- Detects dependency pins like
flask==0.12ordjango==1.11 - Helps identify outdated or risky components
- Detects dependency pins like
-
A07:2021 β Identification and Authentication Failures
- Detects default credentials (
admin,password) - Flags login routes without auth checks
- Warns about disabled TLS verification (
verify=False)
- Detects default credentials (
-
A08:2021 β Software and Data Integrity Failures
- Detects dangerous use of
eval() - Warns about unsafe deserialization (
pickle.load) - Flags subprocess calls with
shell=True
- Detects dangerous use of
-
A09:2021 β Security Logging and Monitoring Failures
- Detects print statements in auth flows
- Flags bare
except:blocks with no logging - Warns when secrets are printed to stdout
-
A10:2021 β Server-Side Request Forgery (SSRF)
- Detects unvalidated user input passed into
requests.get/post
- Detects unvalidated user input passed into
-
test_positive.py
A deliberately vulnerable file that triggers all implemented OWASP rules (A01βA10). -
test_negative.py
A safe baseline file with secure practices β should pass with no findings.
Used for regression testing and validation.
- Findings are grouped by OWASP category (A01βA10)
- Severity levels are colour-coded:
- π΄ High
- π Medium
- π’ Low
Example: === A01: Injection (2 findings) === Summary: High: 2
β’ Line 60 | Severity HIGH | Confidence MEDIUM β SQL query created via string concatenation: ...
cd path/to/owasp-scanner
set PYTHONPATH=.
python scanner/main.py tests/test_positive.py
Developed by Liana Perry (2025) Cybersecurity SecDevOps Sub-team | Redback Operations
This project is inspired by the original vulnerability scanning logic created by Amir Zandieh, and extends it into a modular and OWASP-aligned security scanning tool for pull requests.