# Log4j Vulnerability Fix

The logj vulnerability (CVE-2021-44228) affects versions between 2.0 and 2.17.0 A malicious attacker can forge a log string by forcing the library, through the JNDI tag, to load and execute code hosted on another system, outside the domain where the application is installed.

Admins can set the env flag -Dlog4j2.formatMsgNoLookups=true as an immediate fix

Next remove the class&#x20;

```
zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
```

The permanent fix is to replace the log4j jars in the classpath with the version 2.17.1 or later


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.invariant.io/troubleshooting/log4j-vulnerability-fix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
