WARNING: This application is intentionally vulnerable and meant for educational purposes only. DO NOT deploy this in any production environment.
This application demonstrates common security vulnerabilities based on OWASP Top 10 (2021). It consists of two microservices:
- Auth Service: Handles user authentication with intentional vulnerabilities
- Profile Service: Manages user profile data with intentional vulnerabilities
- No role-based access control implementation
- Direct object references without verification
- Location:
auth_service/routes.py
- endpoint/api/user/<id>
- Passwords stored with weak hashing (MD5)
- Sensitive data transmitted without encryption
- Location:
auth_service/utils.py
-hash_password()
function
- SQL injection vulnerability in login query
- NoSQL injection in profile lookup
- Location:
auth_service/routes.py
-/login
endpoint - Location:
profile_service/routes.py
-/profile
endpoint
- No rate limiting on login attempts
- Password reset without verification
- Location:
auth_service/routes.py
- all endpoints
- Debug mode enabled
- Default/weak credentials
- Location:
config.py
- all configuration settings
- Outdated dependencies in requirements.txt
- Known vulnerable versions of packages
- Weak password requirements
- Session tokens without expiry
- Location:
auth_service/utils.py
-validate_password()
function
- No integrity checks on uploaded files
- Unsecured deserialization
- Location:
profile_service/routes.py
-/upload
endpoint
- No logging of security events
- Sensitive data in logs
- Location: Both services lack proper logging
- Unvalidated URL inputs
- Location:
profile_service/routes.py
-/fetch-avatar
endpoint
- Create virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
-
Set up MongoDB:
- Use local MongoDB instance or
- Create free MongoDB Atlas cluster
-
Configure environment:
cp .env.example .env
# Edit .env with your MongoDB URI
- Run services:
# Terminal 1
python auth_service/app.py
# Terminal 2
python profile_service/app.py
- SQL Injection:
Username: admin' OR '1'='1
Password: anything
- NoSQL Injection:
{"$gt": ""} in username field
- Weak Passwords:
Any password with length > 1 is accepted
- SSRF Test:
/fetch-avatar?url=file:///etc/passwd
Run security scanners against http://localhost:5000 and http://localhost:5001 to detect vulnerabilities.
This application is for educational purposes only. It contains intentional security vulnerabilities to demonstrate common security issues. DO NOT use any of this code in production environments.