Remote code injection in Log4j
Impact
Log4j versions prior to 2.16.0 are subject to a remote code execution vulnerability via the ldap JNDI parser. As per Apache's Log4j security guide: Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.16.0, this behavior has been disabled by default.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| From 2.13.0 before 2.15.0Ecosystem versions | 2.15.0 |
| From 2.0-beta9 before 2.3.1Ecosystem versions | 2.3.1 |
| From 2.4 before 2.12.2Ecosystem versions | 2.12.2 |
Version evidence: OSV · GHSA-jfh8-c2jp-5v3q
View original version evidence (33 explicit versions)
| Affected range | Recorded fix |
|---|---|
| Earlier releases through 1.2.1.2-jre17 (inclusive)Ecosystem versions | Not recorded |
Version evidence: OSV · GHSA-jfh8-c2jp-5v3q
View original version evidence (362 explicit versions)
Read the explicit versions or original source for affected-version evidence.
Version evidence: OSV · GHSA-jfh8-c2jp-5v3q
View original version evidence (1 explicit versions)
Read the explicit versions or original source for affected-version evidence.
Version evidence: OSV · GHSA-jfh8-c2jp-5v3q
View original version evidence (1 explicit versions)
| Affected range | Recorded fix |
|---|---|
| From 1.8.0 before 1.9.2Ecosystem versions | 1.9.2 |
| From 1.10.0 before 1.10.8Ecosystem versions | 1.10.8 |
| From 1.11.0 before 1.11.10Ecosystem versions | 1.11.10 |
| From 2.0.0 before 2.0.11Ecosystem versions | 2.0.11 |
Version evidence: OSV · GHSA-jfh8-c2jp-5v3q
View original version evidence (39 explicit versions)
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Apache Software Foundation · Apache Log4j2
| Version / range | Source status |
|---|---|
| 2.0-beta9 to before log4j-core* From 2.3.1: unaffected From 2.4: affected From 2.12.2: unaffected From 2.13.0: affected From 2.15.0: unaffected | affected |
Original source description
Summary
Log4j versions prior to 2.16.0 are subject to a remote code execution vulnerability via the ldap JNDI parser. As per Apache's Log4j security guide: Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.16.0, this behavior has been disabled by default.
Log4j version 2.15.0 contained an earlier fix for the vulnerability, but that patch did not disable attacker-controlled JNDI lookups in all situations. For more information, see the Updated advice for version 2.16.0 section of this advisory.
Impact
Logging untrusted or user controlled data with a vulnerable version of Log4J may result in Remote Code Execution (RCE) against your application. This includes untrusted data included in logged errors such as exception traces, authentication failures, and other unexpected vectors of user controlled input.
Affected versions
Any Log4J version prior to v2.15.0 is affected to this specific issue.
The v1 branch of Log4J which is considered End Of Life (EOL) is vulnerable to other RCE vectors so the recommendation is to still update to 2.16.0 where possible.
Security releases
Additional backports of this fix have been made available in versions 2.3.1, 2.12.2, and 2.12.3
Affected packages
Only the org.apache.logging.log4j:log4j-core package is directly affected by this vulnerability. The org.apache.logging.log4j:log4j-api should be kept at the same version as the org.apache.logging.log4j:log4j-core package to ensure compatability if in use.
Remediation Advice
Updated advice for version 2.16.0
The Apache Logging Services team provided updated mitigation advice upon the release of version 2.16.0, which disables JNDI by default and completely removes support for message lookups. Even in version 2.15.0, lookups used in layouts to provide specific pieces of context information will still recursively resolve, possibly triggering JNDI lookups. This problem is being tracked as CVE-2021-45046. More information is available on the GitHub Security Advisory for CVE-2021-45046.
Users who want to avoid attacker-controlled JNDI lookups but cannot upgrade to 2.16.0 must ensure that no such lookups resolve to attacker-provided data and ensure that the the JndiLookup class is not loaded.
Please note that Log4J v1 is End Of Life (EOL) and will not receive patches for this issue. Log4J v1 is also vulnerable to other RCE vectors and we recommend you migrate to Log4J 2.16.0 where possible.
References
- Security advisory nvd.nist.gov/vuln/detail/CVE-2021-44228
- Patch github.com/apache/logging-log4j2/pull/608
- Patch github.com/github/advisory-database/pull/5501
- Source reference cert-portal.siemens.com/productcert/pdf/ssa-397453.pdf
- Public exploit reference packetstormsecurity.com/files/165673/UniFi-Network-Application-Unauthenticated-Log4Shell-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/167794/Open-Xchange-App-Suite-7.10.x-Cross-Site-Scripting-Command-Injection.html
- Public exploit reference packetstormsecurity.com/files/167917/MobileIron-Log4Shell-Remote-Command-Execution.html
- Public exploit reference packetstormsecurity.com/files/171626/AD-Manager-Plus-7122-Remote-Code-Execution.html
- Security advisory psirt.global.sonicwall.com/vuln-detail/SNWLID-2021-0032
- Security advisory sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd
- Source reference seclists.org/fulldisclosure/2022/Dec/2
- Source reference seclists.org/fulldisclosure/2022/Jul/11
- Source reference seclists.org/fulldisclosure/2022/Mar/23
- Source reference security.netapp.com/advisory/ntap-20211210-0007
- Source reference support.apple.com/kb/HT213189
- Security advisory tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd
- Source reference twitter.com/kurtseifried/status/1469345530182455296
- Security advisory www.bentley.com/en/common-vulnerability-exposure/be-2022-0001
- Security advisory www.cisa.gov/known-exploited-vulnerabilities-catalog
- Security advisory www.debian.org/security/2021/dsa-5020
- Security advisory www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00646.html
- Source reference www.kb.cert.org/vuls/id/930724
- Security advisory www.nu11secur1ty.com/2021/12/cve-2021-44228.html
- Security advisory www.oracle.com/security-alerts/alert-cve-2021-44228.html
- Security advisory www.oracle.com/security-alerts/cpuapr2022.html
- Security advisory www.oracle.com/security-alerts/cpujan2022.html
- Source reference cert-portal.siemens.com/productcert/pdf/ssa-479842.pdf
- Source reference cert-portal.siemens.com/productcert/pdf/ssa-661247.pdf
- Source reference cert-portal.siemens.com/productcert/pdf/ssa-714170.pdf
- Security advisory github.com/advisories/GHSA-7rjr-3q55-vv33
- Source reference github.com/apache/logging-log4j2
- Source reference github.com/cisagov/log4j-affected-db
- Source reference github.com/cisagov/log4j-affected-db/blob/develop/SOFTWARE-LIST.md
- Security advisory github.com/nu11secur1ty/CVE-mitre/tree/main/CVE-2021-44228
- Source reference github.com/tangxiaofeng7/apache-log4j-poc
- Source reference issues.apache.org/jira/browse/LOG4J2-3198
- Source reference issues.apache.org/jira/browse/LOG4J2-3201
- Source reference issues.apache.org/jira/browse/LOG4J2-3214
- Source reference issues.apache.org/jira/browse/LOG4J2-3221
- Source reference lists.debian.org/debian-lts-announce/2021/12/msg00007.html
- Source reference lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M5CSVUNV4HWZZXGOKNSK6L7RPM7BOKIB
- Source reference lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VU57UJDCFIASIO35GC55JMKSRXJMCDFM
- Source reference lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/M5CSVUNV4HWZZXGOKNSK6L7RPM7BOKIB
- Source reference lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VU57UJDCFIASIO35GC55JMKSRXJMCDFM
- Source reference logging.apache.org/log4j/2.x/changes-report.html
- Source reference logging.apache.org/log4j/2.x/manual/lookups.html
- Source reference logging.apache.org/log4j/2.x/manual/migration.html
- Security advisory logging.apache.org/log4j/2.x/security.html
- Security advisory msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2
- Public exploit reference packetstormsecurity.com/files/165225/Apache-Log4j2-2.14.1-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/165260/VMware-Security-Advisory-2021-0028.html
- Public exploit reference packetstormsecurity.com/files/165261/Apache-Log4j2-2.14.1-Information-Disclosure.html
- Public exploit reference packetstormsecurity.com/files/165270/Apache-Log4j2-2.14.1-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/165281/Log4j2-Log4Shell-Regexes.html
- Public exploit reference packetstormsecurity.com/files/165282/Log4j-Payload-Generator.html
- Public exploit reference packetstormsecurity.com/files/165306/L4sh-Log4j-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/165307/Log4j-Remote-Code-Execution-Word-Bypassing.html
- Public exploit reference packetstormsecurity.com/files/165311/log4j-scan-Extensive-Scanner.html
- Public exploit reference packetstormsecurity.com/files/165371/VMware-Security-Advisory-2021-0028.4.html
- Public exploit reference packetstormsecurity.com/files/165532/Log4Shell-HTTP-Header-Injection.html
- Public exploit reference packetstormsecurity.com/files/165642/VMware-vCenter-Server-Unauthenticated-Log4Shell-JNDI-Injection-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/165673/UniFi-Network-Application-Unauthenticated-Log4Shell-Remote-Code-Execution.html
- Public exploit reference packetstormsecurity.com/files/167794/Open-Xchange-App-Suite-7.10.x-Cross-Site-Scripting-Command-Injection.html
- Public exploit reference packetstormsecurity.com/files/167917/MobileIron-Log4Shell-Remote-Command-Execution.html
- Public exploit reference packetstormsecurity.com/files/171626/AD-Manager-Plus-7122-Remote-Code-Execution.html
- Source reference seclists.org/fulldisclosure/2022/Dec/2
- Source reference seclists.org/fulldisclosure/2022/Jul/11
- Source reference seclists.org/fulldisclosure/2022/Mar/23
- Security advisory www.openwall.com/lists/oss-security/2021/12/10/1
- Security advisory www.openwall.com/lists/oss-security/2021/12/10/2
- Security advisory www.openwall.com/lists/oss-security/2021/12/10/3
- Security advisory www.openwall.com/lists/oss-security/2021/12/13/1
- Security advisory www.openwall.com/lists/oss-security/2021/12/13/2
- Security advisory www.openwall.com/lists/oss-security/2021/12/14/4
- Security advisory www.openwall.com/lists/oss-security/2021/12/15/3
- Source reference security.netapp.com/advisory/ntap-20211210-0007/
- Source reference lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VU57UJDCFIASIO35GC55JMKSRXJMCDFM/
- Security advisory msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2/
- Source reference lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/M5CSVUNV4HWZZXGOKNSK6L7RPM7BOKIB/