| author | Daniel Garcia (cr0hn) |
|---|---|
| description | An intentionally vulnerable Node.js web application for security training and testing |
| last_changed | 2025-11-27 |
A deliberately vulnerable Node.js web application for security research and education
- Overview
- Security Disclaimer
- Features
- Quick Start
- Installation
- Configuration
- API Endpoints
- Vulnerabilities
- Project Structure
- Screenshots
- Contributing
- References
- License
| Property | Value |
|---|---|
| Codename | PsEA |
| Version | 1.0 |
| Repository | https://github.com/cr0hn/vulnerable-node |
| Issues | https://github.com/cr0hn/vulnerable-node/issues/ |
| Author | Daniel Garcia (cr0hn) - @ggdaniel |
Vulnerable Node is an intentionally insecure web application designed with real, exploitable vulnerabilities. Unlike simulated vulnerable applications, this project contains actual security flaws in the source code.
Caution
This application is intentionally vulnerable and should NEVER be deployed in a production environment or exposed to the internet. Use only in isolated testing environments.
This project was created to:
- Test security analyzers - Measure the quality of static and dynamic security analysis tools
- Train security researchers - Practice identifying and exploiting real vulnerabilities
- Educate developers - Learn how NOT to program in Node.js
- Support penetration testing - Provide a safe, legal target for testing security tools
Similar projects like OWASP NodeGoat use simulated vulnerabilities that don't represent real-world insecure code. Vulnerable Node provides actual vulnerable code patterns that security tools should detect.
Warning
FOR EDUCATIONAL PURPOSES ONLY
- Do not deploy this application on any public network
- Do not use this application with real user data
- Always run in an isolated environment (Docker recommended)
- The authors are not responsible for misuse of this software
- Using techniques from this project against unauthorized systems is illegal
The application simulates a small e-commerce shop with:
- User Authentication - Login and logout functionality
- Product Catalog - Browse available products
- Product Search - Search products by name or description
- Product Details - View individual product information
- Purchase System - Buy products (simulated)
- Purchase History - View purchased products
# Clone the repository
git clone https://github.com/cr0hn/vulnerable-node.git
cd vulnerable-node
# Build and start with Docker Compose
docker-compose build && docker-compose up
# Access the application
# Open http://127.0.0.1:3000 in your browserDefault Credentials:
| Username | Password |
|---|---|
| admin | admin |
| roberto | asdfpiuw981 |
- Docker and Docker Compose (recommended)
- OR Node.js 19.x and PostgreSQL
- Clone the repository:
git clone https://github.com/cr0hn/vulnerable-node.git
cd vulnerable-node- Build and run the containers:
docker-compose build
docker-compose up- Access the application at
http://127.0.0.1:3000
-
Install PostgreSQL and create a database named
vulnerablenode -
Clone and install dependencies:
git clone https://github.com/cr0hn/vulnerable-node.git
cd vulnerable-node
npm install- Set the environment variable:
# For local PostgreSQL
export STAGE=LOCAL
# For development server
export STAGE=DEVEL- Start the application:
npm startThe application uses environment variables for configuration:
| Variable | Values | Description |
|---|---|---|
STAGE |
DOCKER, LOCAL, DEVEL |
Database connection mode |
Database Connections:
| Mode | Connection String |
|---|---|
DOCKER |
postgres://postgres:postgres@postgres_db/vulnerablenode |
LOCAL |
postgres://postgres:postgres@127.0.0.1/vulnerablenode |
DEVEL |
postgres://postgres:postgres@10.211.55.70/vulnerablenode |
| Method | Endpoint | Description |
|---|---|---|
GET |
/login |
Display login page |
POST |
/login/auth |
Authenticate user |
GET |
/logout |
Logout and destroy session |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
List all products |
GET |
/products/search?q={query} |
Search products |
GET |
/products/detail?id={id} |
Get product details |
GET, POST |
/products/buy |
Purchase a product |
GET |
/products/purchased |
View purchase history |
Note
All product endpoints require authentication. Unauthenticated requests are redirected to /login.
This project contains vulnerabilities from the OWASP Top 10 (2013 categories, which align with the OWASP Top 10):
| ID | Vulnerability | Affected Areas |
|---|---|---|
| A1 | Injection (SQL) | model/auth.js, model/products.js |
| A2 | Broken Authentication | Session management, password storage |
| A3 | Cross-Site Scripting (XSS) | views/search.ejs, views/login.ejs |
| A4 | Insecure Direct Object References | /products/detail endpoint |
| A5 | Security Misconfiguration | Error handling, default credentials |
| A6 | Sensitive Data Exposure | Plain text passwords, hardcoded secrets |
| A8 | Cross-Site Request Forgery | /products/buy endpoint |
| A10 | Unvalidated Redirects | Login redirect parameter |
Additional Vulnerabilities:
- Regular Expression Denial of Service (ReDoS)
- Log Injection
Tip
See docs/VULNERABILITIES.md for detailed vulnerability documentation including exact code locations and example exploits.
The attacks/ directory contains demonstration scripts:
attacks/
├── csrf/ # CSRF attack examples
├── evil_regex/ # ReDoS attack examples
├── sqli/ # SQL injection with sqlmap
└── log_injection.sh
See docs/ATTACKS.md for usage instructions.
vulnerable-node/
├── app.js # Main Express application
├── config.js # Database configuration
├── dummy.js # Seed data
├── package.json # Dependencies
├── Dockerfile # Node.js container
├── docker-compose.yml # Multi-container setup
│
├── bin/
│ └── www # Server startup
│
├── model/
│ ├── auth.js # Authentication (SQL injection)
│ ├── init_db.js # Database initialization
│ └── products.js # Product queries (SQL injection)
│
├── routes/
│ ├── login.js # Auth routes
│ ├── login_check.js # Auth middleware
│ └── products.js # Product routes
│
├── views/ # EJS templates
├── public/ # Static assets
├── attacks/ # Exploit examples
├── services/ # PostgreSQL setup
└── docs/ # Documentation
See docs/ARCHITECTURE.md for detailed architecture documentation.
Login Screen:
Product Catalog:
Shopping:
Purchase History:
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Adding new vulnerabilities
- Creating attack examples
- Improving documentation
- Code style requirements
Important
This is an intentionally vulnerable application. Please do not submit PRs that fix the security vulnerabilities unless specifically requested.
Support this project (to solve issues, new features...) by using the GitHub "Sponsor" button.
Resources used in creating this project:
This project is released under the BSD License. See LICENSE for details.




