Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. org.apache.logging.log4j/log4j
  4. ›
  5. CVE-2021-45046

CVE-2021-45046: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

December 14, 2021 (updated October 26, 2023)

It was found that the fix to address CVE-2021-44228 in Apache Log4j was incomplete in certain non-default configurations. This could allows attackers with control over Thread Context Map (MDC) input data when the logging configuration uses a non-default Pattern Layout with either a Context Lookup (for example, $${ctx:loginId}) or a Thread Context Map pattern (%X, %mdc, or %MDC) to craft malicious input data using a JNDI Lookup pattern resulting in a denial of service (DOS) attack. Log4j restricts JNDI LDAP lookups to localhost by default. Note that previous mitigations involving configuration such as to set the system property log4j2.noFormatMsgLookup to true do NOT mitigate this specific vulnerability. Log4j fixes this issue by removing support for message lookup patterns and disabling JNDI functionality by default.

References

  • www.openwall.com/lists/oss-security/2021/12/14/4
  • logging.apache.org/log4j/2.x/security.html
  • nvd.nist.gov/vuln/detail/CVE-2021-45046

Code Behaviors & Features

Detect and mitigate CVE-2021-45046 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0 before 2.3.1, all versions starting from 2.4 before 2.12.3, all versions starting from 2.13 before 2.17.0

Fixed versions

  • 2.3.1
  • 2.12.3
  • 2.17.0

Solution

Upgrade to versions 2.3.1, 2.12.3, 2.17.0 or above.

Impact 9 CRITICAL

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')

Source file

maven/org.apache.logging.log4j/log4j/CVE-2021-45046.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:19 +0000.