This repository contains an intentionally vulnerable Python Flask application used to demonstrate various security testing tools and DevSecOps practices. WARNING: This application contains serious security vulnerabilities. DO NOT use in production!
-
SAST (Static Application Security Testing) Issues:
- Hardcoded secrets
- Weak password hashing (MD5)
- SQL injection vulnerabilities
- Command injection possibilities
- Debug mode enabled in production
-
SCA (Software Composition Analysis) Issues:
- Outdated dependencies
- Known vulnerable packages
- Insecure package versions
-
Other Security Issues:
- Server-Side Template Injection
- Unsafe deserialization
- Path traversal vulnerabilities
- Weak JWT implementation
vulnerable-python-app/
├── app.py # Vulnerable Flask application
├── requirements.txt # Python dependencies
├── .github/
│ └── workflows/
│ └── security-scan.yml # GitHub Actions security workflow
└── README.md
-
SAST Tools:
- Bandit:
bandit -r . - Pylint:
pylint --recursive=y . - Semgrep: Uses
p/pythonandp/security-auditrulesets
- Bandit:
-
Dependency Scanning:
- Safety:
safety check - Snyk (requires token): Comprehensive dependency scanning
- Safety:
-
DAST Tools:
- OWASP ZAP: Dynamic application security testing
-
Secret Scanning:
- GitLeaks: Scans for exposed secrets
- Clone the repository:
git clone https://github.com/yourusername/vulnerable-python-app.git
cd vulnerable-python-app- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- SAST with Bandit:
pip install bandit
bandit -r . -f json -o bandit-results.json- Dependencies check with Safety:
pip install safety
safety check- Run Pylint:
pip install pylint
pylint --recursive=y .The repository includes a GitHub Actions workflow that automatically runs security scans on push and pull requests. To use it:
-
Add required secrets to your GitHub repository:
SNYK_TOKEN(if using Snyk)
-
The workflow will run automatically on push/PR to main branch
-
Check the Actions tab in GitHub for scan results
This application is intentionally vulnerable and is meant for educational purposes only. It contains serious security issues and should never be deployed in a production environment.
Feel free to suggest improvements or add new security tests by creating a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.