Simple Logging Facade for Java (SLF4J)
+Simple Logging Facade for Java (SLF4J)
The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging frameworks @@ -39,8 +39,8 @@
Note that SLF4J-enabling your library implies the addition of only a single mandatory dependency, namely slf4j-api.jar. - If no binding is found on the class path, then SLF4J will default to - a no-operation implementation. + If no binding/provider is found on the class path, then SLF4J will + default to a no-operation implementation.
In case you wish to migrate your Java source files to SLF4J, diff --git a/slf4j-site/src/site/pages/log4shell.html b/slf4j-site/src/site/pages/log4shell.html index fdd9d63f..c14c35dc 100644 --- a/slf4j-site/src/site/pages/log4shell.html +++ b/slf4j-site/src/site/pages/log4shell.html @@ -28,22 +28,23 @@
Comments on the CVE-2021-44228 vulnerability
+Comments on the log4shell(CVE-2021-44228) vulnerability
Preamble
-The JNDI/LDAP/RMI/X serialization rabbit hole runs deep and - leads to much uncertainty. Thus, the contents of this page - are the result of our current knowledge and are provided AS IS - without warranty of any kind.
- +The contents of this page are the result of our + understanding of the situation and are provided AS IS without + warranty of any kind.
+ +What is CVE-2021-44228?
-CVE-2021-44228 is a vulnerability classified under the - highest severity mark, i.e. 10 out of 10. It allows an attacker - to execute arbitrary code by injecting attacker-controlled data - into a logged message. As far as vulnerabilities are concerned, - CVE-2021-44228 is probably as bad as it gets. +
CVE-2021-44228 + is a vulnerability classified under the highest severity mark, + i.e. 10 out of 10. It allows an attacker to execute arbitrary + code by injecting attacker-controlled data into a logged + message. As far as vulnerabilities are concerned, CVE-2021-44228 + is probably as bad as it gets.
However, logback may make JNDI calls from within its - configuration file. This was recently - reported as a vulnerability of lesser severity. In response, we have released - logback version 1.2.8. Please upgrade. + configuration file. This was recently reported + in CVE-2021-42550 + (aka LOGBACK-1591) + as a vulnerability of lesser + severity. In response, we have released logback version + 1.2.9. Please upgrade.
Note that the vulnerability affecting logback requires write @@ -159,18 +161,23 @@
- attacker has write access to logback.xml -
- use of logback version older than 1.2.8 +
- use of logback version older than 1.2.9
- loading of poisoned configuration data, which implies application restart or scan="true" set prior to attack
As a belt-and-suspenders type of precaution, in addition to - upgrading to logback version 1.2.8, we also recommend users to + upgrading to logback version 1.2.9, we also recommend users to deploy their logback configuration files as read-only.
-If you have read thus far, you - probably understand that log4Shell/CVE-2021-44228 and - LOGBACK-1591 are of different severity levels.
+More details about the contents latest logback releases can + be found in the logback + news page. + +
If you have read thus far, you probably + understand that log4Shell/CVE-2021-44228 and + LOGBACK-1591/CVE-2021-42550 are of different severity + levels.
Additional protective
measure: write protect log4j{1,2}/logback configuration
@@ -211,10 +218,116 @@
owner. If possible, they should also be monitored
against changes and unauthorized manipulation.
-
+ Prevalence of logging
+ frameworks
+
+
As discussed above, while log4j 2.14 and earlier are + vulnerable to log4shell, log4j 1.x and logback are not.
+ +At this stage, it might be useful mention the prevalence of + each logging library in order to put things into + perspective. Here are the relevant figures as found + in mvnrepository site + on 2021-12-17.
+ +| Project | +Category | +group:artifact | +usageCount | +percentage | +
|---|---|---|---|---|
| SLF4J | +API | +org.slf4j:slf4j-api | +52,247 | +69% | +
| Commons-logging | +API | +commons-logging:commons-logging | +10,412 | +14% | +
| SLF4J | +API | +org.slf4j:jcl-over-slf4j | +7,546 | +10% | +
| LOG4J2 | +API | +org.apache.logging.log4j:log4j-api | +5,226 | +7% | +
| Total | +API | +- | +45,174 | +100% | +
| Project | +Category | +group:artifact | +usageCount | +percentage | +
|---|---|---|---|---|
| LOGBACK | +implementation | +ch.qos.logback:logback-classic | +21,770 | +48% | +
| LOG4J1 | +implementation | +log4j:log4j | +16,610 | +37% | +
| LOG4J2 | +implementation | +org.apache.logging.log4j:log4j-core | +6,974 | +15% | +
| Total | +implementaion | +- | +45,174 | +100% | +
Notwithstanding its 48% prevalence overall (implementation), + no attacks have been reported against logback that we are aware + of.
+