Home > Enterprise >  Log4j Vulnerability (CVE-2021-44228) on Google Cloud Platform and PCF
Log4j Vulnerability (CVE-2021-44228) on Google Cloud Platform and PCF

Time:12-14

Currently there are so many suggested steps that have been posted for excluding log4j-core library from dependency or upgrading to the latest (above version 2.15) version according to Spring Blog . Are there any recommended tools that can be used for protecting spring application deployed in Google App Engine or Pivotal Cloud Foundry(PCF) for protecting instead of patching them for redeployment?

Another necessary question is, does it make my application(microservice spring application) to be vulnerable if it uses another microservice for some of its service if it depends on another microservice and if that microservice already uses vulnerable version of log4j-core?

CodePudding user response:

Short answer to your first question is may be. You can protect your application/service by using rules in WAF to discard the ${jndi://ldap pattern. However, there are so many mutations of this (base64 encoding etc.) that it will not be foolproof. If you are worried about dependencies, you should set the JVM Parameter and redeploy your app to prevent the lookup as a workaround.

Regarding your 2nd question - the answer is yes if the the 2nd micro service is being passed the same input and it's logging.

CodePudding user response:

In regard to your first question, you can set an environment variable in order to disable the replacement lookups in log4j:

LOG4J_FORMAT_MSG_NO_LOOKUPS=true

Please note that this only works for log4j >= 2.10.

I believe you can set environment variables in PCF without having to redeploy the service (of course, a restart would be needed), so no new release would be needed. See: https://docs.pivotal.io/pivotalcf/2-3/devguide/deploy-apps/environment-variable.html and https://cli.cloudfoundry.org/en-US/v6/set-env.html

In order to see whether your spring-boot application is vulnerable to the exploit, you could use a spring-boot test I created for that purpose: https://github.com/chilit-nl/log4shell-example - You could test your application with and without the environment variable, to see if it has any effect (assuming that your application currently is vulnerable).

  • Related