A modern web application for managing expense claims, built with Node.js, React, and SQLite. This application is intentionally vulnerable and designed for security workshops and educational purposes. This application was built with AI.
One command to run everything:
docker-compose up --buildThen visit https://localhost:3000 and accept the certificate warning.
Demo Accounts:
- Admin:
admin/password123 - Alice:
alice/password123 - Bob:
bob/password123
That's it! The setup automatically handles database initialization and SSL certificate generation.
DO NOT use this code in production! This application is designed for educational purposes to demonstrate common web security vulnerabilities.
- Frontend: React with Vite for fast development
- Backend: Node.js with Express.js
- Database: SQLite for lightweight local development
- Docker: Full containerization for easy setup
- Security Vulnerabilities: Intentionally vulnerable for workshop scenarios
- Broken Access Control - Users can access admin functions and other users' data
- Cross-Site Request Forgery (CSRF) - Vulnerable cookie settings and no CSRF protection
- Cross-Site Scripting (XSS) - Stored XSS in claim descriptions with non-HttpOnly cookies
- Node.js 18+
- Docker and Docker Compose (optional)
- Git
Simply run:
docker-compose up --buildOr use the convenience script:
./start.shThat's it! The setup automatically:
- β Generates SSL certificates (for HTTPS)
- β Initializes the database with sample data
- β Starts both frontend and backend servers
Access the application:
- Frontend:
https://localhost:3000(accept the certificate warning) - Backend API:
https://localhost:5001
Demo Accounts:
- Admin:
admin/password123 - Alice:
alice/password123 - Bob:
bob/password123
Note: On first run, you'll need to accept the self-signed certificate warnings in your browser.
-
Install dependencies:
# Backend cd backend npm install # Frontend cd ../frontend npm install
-
Generate SSL certificates (for HTTPS):
cd ../backend npm run generate-cert -
Initialize the database:
cd backend npm run init-db -
Start development servers:
# Terminal 1: Backend cd backend npm run dev # Terminal 2: Frontend cd frontend npm run dev
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
claim-manager/
βββ backend/ # Node.js/Express backend
β βββ scripts/
β β βββ init-db.js # Database initialization
β βββ server.js # Main server file
β βββ package.json # Backend dependencies
β βββ Dockerfile # Backend container
βββ frontend/ # React frontend
β βββ src/
β β βββ App.jsx # Main React component
β β βββ main.jsx # React entry point
β β βββ index.css # Global styles
β βββ package.json # Frontend dependencies
β βββ Dockerfile # Frontend container
βββ database/ # SQLite database files
βββ docker-compose.yml # Docker orchestration
βββ package.json # Root package.json
The application includes the following tables:
- users: User accounts and authentication
- claims: Expense claim records
- categories: Claim categories
Sample data is automatically loaded during initialization.
npm run dev- Start with nodemon (auto-restart)npm start- Start production servernpm run init-db- Initialize database with sample datanpm run generate-cert- Generate SSL certificates for HTTPS
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production build
docker-compose up --build- Start the applicationdocker-compose down- Stop containers
GET /- API informationGET /health- Health checkGET /api/test- Test endpointGET /api/claims- Get all claims
This application is designed for web security workshops and includes:
- Basic authentication structure
- SQLite database for easy manipulation
- CORS enabled for cross-origin requests
- JWT token support (ready for implementation)
- Input validation opportunities
- SQL injection testing scenarios
- Ensure the
database/directory exists - Run
npm run init-dbto recreate the database - Check file permissions on the database directory
- Backend runs on port 5000
- Frontend runs on port 3000
- Modify ports in respective package.json files if needed
- Ensure Docker is running
- Try
docker-compose downthendocker-compose up --build - Check logs with
docker-compose logs
The application is now ready for development! You can:
- Add authentication endpoints
- Implement CRUD operations for claims
- Add user management features
- Implement security features for the workshop
- Add more sophisticated UI components
This is a workshop application. Feel free to modify and extend it for your specific security workshop needs.
This application contains intentional security vulnerabilities for educational purposes. Students should explore the application to identify and understand these vulnerabilities.
MIT License - feel free to use for educational purposes.