This project demonstrates various security vulnerabilities in Java web applications. It's designed to help developers understand common security pitfalls and their potential impacts.
- Java 22
- Gradle
- IDE (VSCode recommended)
- Clone the repository:
git clone [your-repo-url]
cd demo- Build the project:
gradle build- Run the application:
gradle bootRunThe application will start on http://localhost:4949
The project uses H2 database with file persistence:
- Database files are stored in
./data/vulndb.mv.db - Initial schema and data are automatically created on first run
- Access H2 Console at:
http://localhost:4949/h2-console
H2 Console Connection Settings:
- JDBC URL:
jdbc:h2:file:./data/vulndb - Username:
sa - Password:
password
GET /api/sqlExample?userId=1GET /api/user/profile?userId=1&profileData=test
GET /api/getExample?input=testPOST /api/postExample{ "input": "command" }
POST /api/user/login{ "username": "admin", "password": "admin123" }
GET /api/readFile?path=test.txtPOST /api/writeFile{ "path": "test.txt", "content": "Hello" }
The project includes examples of real-world vulnerabilities found in popular Java frameworks and libraries:
- CVE-2022-22965 (Spring4Shell) - Remote Code Execution via Data Binding
- CVE-2018-1258 - Spring Security OAuth Authentication Bypass
- CVE-2021-44228 (Log4Shell) - Remote Code Execution via JNDI Injection
- CVE-2019-17571 - Apache Log4j Socket Server Deserialization
- CVE-2017-5645 - Log4j TCP Socket Server Unsafe Deserialization
- CVE-2020-36518 - Jackson Polymorphic Deserialization
- CVE-2019-12384 - H2 Database Console JNDI Injection
- CVE-2015-7501 - Apache Commons Collections Unsafe Deserialization
- CVE-2016-4437 - Apache Shiro Authentication Bypass (Padding Oracle)
- CVE-2020-13942 - Apache Unomi MVEL Injection
Access these examples at /api/cve/* endpoints. Each vulnerability is documented with:
- Original CVE reference
- Vulnerability description
- Example exploit
- Code commentary
The application comes pre-loaded with test data:
- admin:admin123 (ADMIN role)
- user1:password123 (USER role)
- test:test123 (USER role)
- guest:guest123 (GUEST role)
- system:system123 (SYSTEM role)
- system_config
- user_preferences
- api_keys
- feature_flags
- system_status
- The application uses Spring Boot 3.3.5
- H2 database for simplified setup and testing
- All endpoints are intentionally vulnerable
- Logging is enabled for better debugging
- Fork the repository
- Create your feature branch (
git checkout -b feature/vulnerability) - Commit your changes (
git commit -am 'Add new vulnerability') - Push to the branch (
git push origin feature/vulnerability) - Create a Pull Request
This application contains intentional security vulnerabilities for educational purposes. It should never be:
- Deployed in a production environment
- Used as a template for real applications
- Exposed to the public internet
[Your License Here]