VulnMart is an intentionally vulnerable full-stack e-commerce web application designed for cybersecurity training, penetration testing practice, code review, and DevSecOps learning.
Caution
DISCLAIMER: FOR EDUCATIONAL AND LAB USE ONLY This application contains intentionally severe vulnerabilities (RCE, SQL Injection, SSRF, XXE, Broken Auth, and more). Never deploy or expose this application to the public internet or untrusted networks. Run only within isolated local or lab environments.
| Component | Technology | Container Name | Internal Port | Host Port |
|---|---|---|---|---|
| Reverse Proxy | Nginx 1.25 | vulnmart-nginx |
80 |
8080 (Primary Entry Point) |
| Frontend | React 18, React Router v6 | vulnmart-frontend |
3000 |
3000 |
| Backend API | Node.js 20, Express, pg |
vulnmart-backend |
4000 |
4000 |
| Database | PostgreSQL 15 | vulnmart-db |
5432 |
5432 |
Browser / Attacker
│
▼
[ Nginx Proxy ] (Port 8080)
├───► / (Frontend UI - React :3000)
├───► /api/* (Express Backend :4000)
├───► /uploads/* (Static Uploads Directory)
└───► /internal/* (Admin Gateway Route)
│
▼
[ PostgreSQL ] (Port 5432)
Clone the repository and launch the container cluster:
git clone git@github.com:sameer0xsec/vulnmart.git
cd vulnmart
docker compose up -d --buildAccess the application in your browser at:
👉 http://localhost:8080
To stop and remove containers:
docker compose down -vThe database is pre-seeded with sample user accounts (passwords stored using intentional weak MD5 hashing):
| Username | Password | Role | Purpose |
|---|---|---|---|
admin |
admin123 |
admin |
Administrative account |
alice |
password123 |
user |
Regular customer account |
bob |
letmein |
user |
Regular customer account |
VulnMart implements 25+ deliberate security flaws with comprehensive inline code annotations (// VULN:). Full exploit details and remediation guidance can be found in VULNERABILITIES.md.
- SQL Injection (Login Bypass): Authentication SQL string concatenation (
auth.js). - SQL Injection (UNION Exfiltration): Product search endpoint leaks complete user tables including credential hashes.
- Remote OS Command Injection: Shell execution (
exec()) during invoice PDF generation (invoice.js). - XML External Entity (XXE): Product bulk import parser vulnerable to file disclosure and SSRF (
import.js). - Server-Side Prototype Pollution: Insecure
lodash.mergeon cart restoration (import.js).
- JWT Algorithm "none" Vulnerability: Verification accepts unverified
nonealgorithmic tokens. - Weak Hardcoded JWT Secret: Symmetric HS256 secret (
secret123) easily cracked offline. - Weak Password Storage: Legacy unsalted MD5 hashes in database and seed scripts.
- No Rate Limiting / Brute-Force: Lack of throttling on authentication endpoints.
- Insecure Cookies: Missing
HttpOnly,Secure, andSameSiteflags on authentication cookies.
- Mass Assignment: Registration accepts arbitrary
roleparameters allowing direct self-assignment toadmin. - Vertical Privilege Escalation: User role-update endpoint missing administrative checks.
- Missing Function-Level Access Control: Unauthenticated/unauthorized product deletion endpoint.
- Insecure Direct Object Reference (IDOR): Predictable numeric IDs expose any user's order details.
- Stored Cross-Site Scripting (XSS): Unsanitized product reviews rendered with
dangerouslySetInnerHTML. - Reflected Cross-Site Scripting (XSS): Search query parameters rendered raw into the DOM.
- Open Redirect: Unvalidated redirect URL parameter on login completion.
- Arbitrary File Upload: Unrestricted avatar and product image uploads without MIME or extension validation.
- Path Traversal: Arbitrary local file disclosure through unvalidated file name query parameters (
/api/files).
- Server-Side Request Forgery (SSRF): Remote product image importer allows probing internal container networks and cloud metadata services.
- Sensitive Data Exposure: User management endpoints leaking password hashes in JSON responses.
- Insecure CORS: Reflects arbitrary
Originheaders combined withcredentials: true. - Nginx Configuration Flaws: Enabled
server_tokens, directory listing (autoindex on), and direct unauthenticated reverse proxy routing to/internal/.
- Initial Access: Bypass login via SQL Injection (
admin' --) or register a new user with{"role": "admin"}via Mass Assignment. - Internal Reconnaissance: Utilize the SSRF import endpoint (
/api/import/product-image-from-url) to scan internal microservices and database ports. - Data Exfiltration: Perform UNION SQL injection on
/api/products/search/queryor exploit XXE in/api/import/products-bulk-xmlto read sensitive files (e.g.,/etc/passwd). - Remote Code Execution: Exploit the Command Injection flaw on
/api/invoice/:id/pdfto gain shell access inside the backend container.
- Reconnaissance: Explore the application manually via the browser and map API endpoints using Burp Suite or
curl. - Vulnerability Assessment: Follow the test cases outlined in VULNERABILITIES.md.
- Exploitation: Build automated PoC scripts verifying each vulnerability.
- Remediation: Apply secure coding practices (parameterized queries, input sanitization, token validation, secure headers) and verify that the exploits are mitigated.
This project is created strictly for educational, defensive, and authorized penetration testing training. The author and contributors assume no liability for misuse or damage caused by the use of this software.