Maven build container
Uses the official maven:3-eclipse-temurin-17 image, copies source code and pom.xml, sets working directory to /tmp, and executes 'mvn spring-boot:run' to start the application.
Dockerfile:1-8SQL injection in JDBC Appender in Apache Log4j V1
CVE-2022-23305 has a selected CVSS score of 9.8 (critical); EIP currently links 3 repository PoCs and 1 lab environment.
By design, the JDBCAppender in Log4j 1.2.x accepts an SQL statement as a configuration parameter where the values to be inserted are converters from PatternLayout. The message converter, %m, is likely to always be included. This allows attackers to manipulate the SQL by entering crafted strings into input fields or headers of an application that are logged allowing unintended SQL queries to be executed. Note this issue only affects Log4j 1.x when specifically configured to use the JDBCAppender, which is not the default. Beginning in version 2.0-beta8, the JDBCAppender was re-introduced with proper support for parameterized SQL queries and further customization over the columns written to in logs. Apache Log4j 1.2 reached end of life in August 2015. Users should upgrade to Log4j 2 as it addresses numerous other issues from the previous versions.
| Product | Source | Version range | Status |
|---|---|---|---|
Apache Log4j 1.xBrowse Apache Software Foundation / Apache Log4j 1.x | CVE List | 1.2.1 | affected |
| Before 2.0-alpha1 | affected | ||
log4j:log4jBrowse Maven / log4j:log4j | GitHub Advisory | Through 1.2.17 | affected |
org.zenframework.z8.dependencies.commons:log4j-1.2.17Browse Maven / org.zenframework.z8.dependencies.commons:log4j-1.2.17 | GitHub Advisory | Through 2.0 | affected |
A single-container Docker environment based on maven:3-eclipse-temurin-17 that builds and runs a Spring Boot application. The application uses Log4j 1.2.17 with a JDBCAppender writing to an in-memory H2 database, and exposes an HTTP endpoint that logs a user-supplied query parameter, demonstrating SQL injection via Log4j.
Dockerfile:1-8pom.xml:1-39src/main/java/poc/InjectionController.java:1-42The README explicitly states it is a proof-of-concept for CVE-2022-23305, a SQL injection vulnerability in Log4j JDBCAppender. The code and configuration are designed to demonstrate the vulnerability by logging unsanitized user input via JDBCAppender.
README.md:1-3src/main/java/poc/InjectionController.java:24-28Uses the official maven:3-eclipse-temurin-17 image, copies source code and pom.xml, sets working directory to /tmp, and executes 'mvn spring-boot:run' to start the application.
Dockerfile:1-8A Spring Boot web application with a single endpoint at '/' that accepts a 'param' query parameter, logs it via Log4j, and returns all log entries from the H2 database. The logging uses a JDBCAppender configured in log4j.properties, making it susceptible to SQL injection.
src/main/java/poc/InjectionController.java:1-42src/main/resources/log4j.properties:1-11An in-memory H2 database configured via application.properties and schema.sql. It stores log messages in a 'logs' table. The JDBCAppender inserts log entries directly, and the application reads them back to display.
src/main/resources/application.properties:1-5src/main/resources/schema.sql:1-4Log4j 1.2.17 configured with a JDBCAppender that writes log messages directly to the H2 database using the SQL statement 'insert into logs values('%m')'. The message includes unsanitized user input, enabling SQL injection.
src/main/resources/log4j.properties:1-11pom.xml:22-26Supported by supplied evidence
The environment uses Log4j 1.2.17 with a JDBCAppender that logs unsanitized user input, directly matching the described SQL injection vulnerability. The README and code comments explicitly reference CVE-2022-23305 and provide a working exploit example.
README.md:1-3src/main/java/poc/InjectionController.java:24-28pom.xml:22-26README.md:8-10README.md:7-10README.md:11-13README.md:9README.md:10README.md:12-13README.md:14All visible behavior is confined to the containerized lab environment. The application only interacts with its own in-memory H2 database and exposes a single HTTP endpoint on port 8080. There is no evidence of host filesystem access, external network connections, credential theft, persistence, or any behavior beyond demonstrating the SQL injection vulnerability.
Dockerfile:1-8src/main/java/poc/InjectionController.java:1-42src/main/resources/application.properties:1-5This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.