A deliberately vulnerable web application for practicing application security testing, secure code review and implementing security in CI/CD pipelines.
This project is a simple banking application with multiple security vulnerabilities built in. It's designed to help security engineers, developers, interns, QA analyst and DevSecOps practitioners learn about:
- Common web application and API vulnerabilities
- Secure coding practices
- Security testing automation
- DevSecOps implementation
- π User Authentication & Authorization
- π° Account Balance Management
- πΈ Money Transfers
- π Loan Requests
- π€ Profile Picture Upload
- π Transaction History
- π Password Reset System (3-digit PIN)
- π³ Virtual Cards Management
- π± Bill Payments System
-
Authentication & Authorization
- SQL Injection in login
- Weak JWT implementation
- Broken object level authorization (BOLA)
- Broken object property level authorization (BOPLA)
- Mass Assignment & Excessive Data Exposure
- Weak password reset mechanism (3-digit PIN)
- Token stored in localStorage
- No server-side token invalidation
- No session expiration
-
Data Security
- Information disclosure
- Sensitive data exposure
- Plaintext password storage
- SQL injection points
- Debug information exposure
- Detailed error messages exposed
-
Transaction Vulnerabilities
- No amount validation
- Negative amount transfers possible
- No transaction limits
- Race conditions in transfers and balance updates
- Transaction history information disclosure
- No validation on recipient accounts
-
File Operations
- Unrestricted file upload
- Path traversal vulnerabilities
- No file type validation
- Directory traversal
- No file size limits
- Unsafe file naming
-
Session Management
- Token vulnerabilities
- No session expiration
- Weak secret keys
- Token exposure in URLs
-
Client and Server-Side Flaws
- Cross Site Scripting (XSS)
- Cross Site Request Forgery (CSRF)
- Insecure direct object references
- No rate limiting
-
Virtual Card Vulnerabilities
- Mass Assignment in card limit updates
- Predictable card number generation
- Plaintext storage of card details
- No validation on card limits
- BOLA in card operations
- Race conditions in balance updates
- Card detail information disclosure
- No transaction verification
- Lack of card activity monitoring
-
Bill Payment Vulnerabilities
- No validation on payment amounts
- SQL injection in biller queries
- Information disclosure in payment history
- Predictable reference numbers
- Transaction history exposure
- No validation on biller accounts
- Race conditions in payment processing
- BOLA in payment history access
- Missing payment limits
- Docker and Docker Compose (for containerized setup)
- PostgreSQL (if running locally)
- Python 3.9 or higher (for local setup)
- Git
- Clone the repository:
git clone https://github.com/Commando-X/vuln-bank.git
cd vuln-bank
- Start the application:
docker-compose up --build
The application will be available at http://localhost:5000
- Clone the repository:
git clone https://github.com/Commando-X/vuln-bank.git
cd vuln-bank
- Build the Docker image:
docker build -t vuln-bank .
- Run the container:
docker run -p 5000:5000 vuln-bank
- Python 3.9 or higher
- PostgreSQL installed and running
- pip (Python package manager)
- Git
- Clone the repository:
git clone https://github.com/Commando-X/vuln-bank.git
cd vuln-bank
- Create and activate a virtual environment (recommended):
# On Windows
python -m venv venv
venv\Scripts\activate
# On Linux/Mac
python3 -m venv venv
source venv/bin/activate
- Install required packages:
pip install -r requirements.txt
- Create necessary directories:
# On Windows
mkdir static\uploads
# On Linux/Mac
mkdir -p static/uploads
-
Modify the .env file:
- Open .env and change DB_HOST from 'db' to 'localhost' for local PostgreSQL connection
-
Run the application:
# On Windows
python app.py
# On Linux/Mac
python3 app.py
The .env
file is intentionally included in this repository to facilitate easy setup for educational purposes. In a real-world application, you should never commit .env
files to version control.
Current environment variables:
DB_NAME=vulnerable_bank
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=db # Change to 'localhost' for local installation
DB_PORT=5432
The application uses PostgreSQL. The database will be automatically initialized when you first run the application, creating:
- Users table
- Transactions table
- Loans table
- Main application:
http://localhost:5000
- API documentation:
http://localhost:5000/api/docs
-
If you get "python not found":
- Ensure Python is added to your system PATH
- Try using
py
instead ofpython
-
Permission issues with uploads folder:
- Run command prompt as administrator
- Ensure you have write permissions in the project directory
-
Permission denied when creating directories:
sudo mkdir -p static/uploads sudo chown -R $USER:$USER static/uploads
-
Port 5000 already in use:
# Kill process using port 5000 sudo lsof -i:5000 sudo kill <PID>
- Connection refused:
- Ensure PostgreSQL is running
- Check credentials in .env file
- Verify PostgreSQL port is not blocked
- SQL Injection in login
- Weak password reset (bruteforce 3-digit PIN)
- JWT token manipulation
- Username enumeration
- Token storage vulnerabilities
- Access other users' transaction history via account number
- Upload malicious files
- Access admin panel
- Manipulate JWT claims
- Exploit BOPLA (Excessive Data Exposure and Mass Assignment)
- Privilege escalation through registration
- Attempt negative amount transfers
- Race conditions in transfers
- Transaction history access
- Balance manipulation
- Upload unauthorized file types
- Attempt path traversal
- Upload oversized files
- Test file overwrite scenarios
- File type bypass
- Token manipulation
- BOLA/BOPLA in API endpoints
- Information disclosure
- Error message analysis
- Exploit mass assignment in card limit updates
- Analyze card number generation patterns
- Access unauthorized card details
- Test card freezing bypasses
- Transaction history manipulation
- Card limit validation bypass
- Test biller enumeration
- Payment amount validation bypass
- Access unauthorized payment history
- SQL injection in biller selection
- Reference number prediction
- Race condition exploitation in payments
Contributions are welcome! Feel free to:
- Add new vulnerabilities
- Improve existing features
- Document testing scenarios
- Enhance documentation
- Fix bugs (that aren't intentional vulnerabilities)
This application contains intentional security vulnerabilities for educational purposes. DO NOT:
- Deploy in production
- Use with real personal data
- Run on public networks
- Use for malicious purposes
- Store sensitive information
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for Security Education