Keycloak is NOT affected by the Log4j remote code injection vulnerability (CVE-2021-44228) #9078
Replies: 14 comments 40 replies
-
|
Is there any minimum version of Keycloak to be used which doesn't have this vulnerability? |
Beta Was this translation helpful? Give feedback.
-
|
Glad to hear. What about the docker image provided, does it include log4j? |
Beta Was this translation helpful? Give feedback.
-
|
CVE-2021-44228 is about log4j 2 (second generation of log4j), but Keycloak uses/has reference to log4j only - almost 10 years old release. |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
Hey Guys, Thanks and Regards |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
Does it make sense to remove the JMSAppender class from the |
Beta Was this translation helpful? Give feedback.
-
|
It looks like wildfly is affected by log4j2 vulnerability. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, in our product we are using the keycloak docker image from https://hub.docker.com/r/jboss/keycloak (tag 8.0.1, yes I know this is VEERY old...). We are using it 'as is' with just some minor configurations. Are we safe with this version according to CVE-2021-44228? Would be great to have a confirmation as our customers currently urgently demand confirmations from us... Thanks for your feedback! Best Regards, Joerg Rohrschneider |
Beta Was this translation helpful? Give feedback.
-
|
for k8s mates, there is a great article from sysdig about mitigation measures - https://sysdig.com/blog/mitigating-log4j-kubernetes-network-policies/ |
Beta Was this translation helpful? Give feedback.
-
|
Is there any way to upgrade log4j 1.2.17 to log4j2 2.15? Or maybe some way to completely remove log4j if is not needed? |
Beta Was this translation helpful? Give feedback.
-
|
There are a number of issues in log4j v1.x:
An update of keycloak to a recent log4j version would be appreciated. |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
Hi guys, We also use docker.io/jboss/keycloak:15.0.0 image.....in the container we can find the following .jars
Can you confirm that the these .jars are save and not affected? |
Beta Was this translation helpful? Give feedback.
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
|
I believe the official statement has been tested with the latest version of Wildfly and result in non exploitable. |
Beta Was this translation helpful? Give feedback.
-
|
a big thank you to all maintainers and contributers for addressing this urgent topic. very much appreciated and extremely helpful in identifying necessary tasks. thanks! |
Beta Was this translation helpful? Give feedback.
-
|
In case someone might be interested: I wrote a shell script to remove log4shell relevant classes from all log4j jars in the file system. https://stackoverflow.com/a/70362694/1948252 In this example the last file was readonly, thus the red notice. |
Beta Was this translation helpful? Give feedback.

{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
Keycloak does not include the Log4j libraries that are affected by the recent remote code injection vulnerability, and for this reason is NOT affected by this vulnerability.
Even though the Log4j APIs are included, as separate log manager is used, which does not include the affected JNDI lookup capability.
Keycloak adapters do not include Log4j directly, but rather depend on what is available in the applicable application servers, so we do highly recommend that you review your applications to verify if they may be affected.
The same applies if you have customised Keycloak, and for some reason included additional Log4j dependencies in the distibution.
Update 20/12/2021
This topic has now been locked for further comments due to irrelevant comments. If you believe there is anything we are missing in our assessment of the Log4j issues please report it to keycloak-security@googlegroups.com and we'll assess it and update this announcement accordingly.
Update 14/12/2021
The WildFly team has published a great blog post summarising the impact of the Log4j security vulnerabilities for WildFly. In summary it validates our previous assessment for Keycloak, and neither WildFly or Keycloak are affected by CVE-2021-44228, or the related CVE-2021-4104 in Log4j 1.
The Quarkus team has also issued a statement that also validates the Keycloak.X Quarkus preview distribution is also not affected.
Update 13/12/2021
Keycloak includes only the Log4j API in the server distribution. Logging is handled by JBoss Logmanager, not Log4j directly. However, JBoss Logmanager does include some Log4j classes itself. There is currently two versions of JBoss Logmanager, the Log4j 2 version. The Log4j 2 version does NOT include the affected JNDILookup class. The Log4j 1 version is not affected by this particular CVE, but there is a related CVE (CVE-2021-4104) that is currently being investigated, which is less critical as the JMSAppender has to be explicitly enabled, does not take user-input for the JNDI lookup, and evidence suggests only strings and not classes can be loaded.
Recommendations:
As an additional note; reviewing the dependencies in Keycloak source code (pom.xml files) does not provide a correct an accurate view. An older version of Log4j is included, but only in test scope, and does not control what is included in the server distribution. Both the Keycloak server and adapters rely on logging libraries provided by the runtime (application server). In the future we are removing the WildFly server distribution, and will deprecate and/or extract adapters into a separate project, this will allow us to clean up the dependencies in the source code, to provide an accurate view.
Beta Was this translation helpful? Give feedback.
All reactions