CVE-2021-44228:Apache Log4j2 Remote Code Execution Vulnerability (Log4Shell)

splash
Back

Description Preview

A critical remote code execution vulnerability in Apache Log4j2 versions 2.0-beta9 through 2.15.0 allows attackers to execute arbitrary code by exploiting the JNDI lookup feature. When message lookup substitution is enabled, an attacker who can control log messages or parameters can trigger remote code execution through LDAP and other JNDI related endpoints. This vulnerability is commonly known as "Log4Shell" and has been actively exploited in the wild since disclosure.

Overview

CVE-2021-44228, also known as Log4Shell, is a severe vulnerability in the Apache Log4j2 library that affects versions 2.0-beta9 through 2.15.0 (excluding security releases 2.12.2, 2.12.3, and 2.3.1). The vulnerability stems from the JNDI (Java Naming and Directory Interface) features used in configuration, log messages, and parameters that fail to protect against attacker-controlled LDAP and other JNDI-related endpoints. When message lookup substitution is enabled, an attacker who can inject malicious strings into logs can trigger remote code execution by forcing the application to connect to a malicious LDAP server. This vulnerability has been assigned a CVSS score of 10.0 (Critical) due to its ease of exploitation and severe impact. The vulnerability affects countless applications and services worldwide as Log4j is widely used in enterprise Java applications, cloud services, and web applications.

Remediation

To remediate the Log4Shell vulnerability, take the following actions:

  1. Update to a patched version:

    • Update to Log4j 2.17.0 or later (recommended)
    • For Java 8 environments: Update to Log4j 2.12.4 or later
    • For Java 7 environments: Update to Log4j 2.3.2 or later
  2. If immediate patching is not possible, implement one of these mitigations:

    • Set system property: -Dlog4j2.formatMsgNoLookups=true
    • Remove the JndiLookup class from the classpath: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
    • Configure the "NoLookups" flag for PatternLayout in the Log4j configuration
  3. Implement network controls:

    • Block outbound connections to unknown or suspicious domains
    • Implement egress filtering to block LDAP/JNDI connections to external servers
    • Deploy WAF rules to detect and block exploitation attempts
  4. Scan your environment:

    • Identify all applications using vulnerable Log4j versions
    • Prioritize internet-facing applications for immediate remediation
    • Use vulnerability scanners to detect vulnerable instances
  5. Monitor for exploitation:

    • Watch for suspicious outbound connection attempts
    • Monitor logs for exploitation patterns like "${jndi:ldap://...}"

References

  1. Apache Log4j Security Page: https://logging.apache.org/log4j/2.x/security.html
  2. CISA Log4j Guidance: https://www.cisa.gov/apache-log4j-vulnerability-guidance
  3. CERT Vulnerability Note VU#930724: https://www.kb.cert.org/vuls/id/930724
  4. Microsoft's Response to Log4Shell: https://msrc-blog.microsoft.com/2021/12/11/microsofts-response-to-cve-2021-44228-apache-log4j2/
  5. Oracle Security Alert for CVE-2021-44228: https://www.oracle.com/security-alerts/alert-cve-2021-44228.html
  6. CISA Log4j Affected Products Database: https://github.com/cisagov/log4j-affected-db
  7. Cisco Security Advisory: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd
  8. NetApp Security Advisory: https://security.netapp.com/advisory/ntap-20211210-0007/

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Health Care & Social Assistance
    Health Care & Social Assistance
  3. Public Administration
    Public Administration
  4. Finance and Insurance
    Finance and Insurance
  5. Educational Services
    Educational Services
  6. Transportation & Warehousing
    Transportation & Warehousing
  7. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  8. Retail Trade
    Retail Trade
  9. Other Services (except Public Administration)
    Other Services (except Public Administration)
  10. Utilities
    Utilities
  11. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  12. Management of Companies & Enterprises
    Management of Companies & Enterprises
  13. Information
    Information
  14. Mining
    Mining
  15. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  16. Construction
    Construction
  17. Accommodation & Food Services
    Accommodation & Food Services
  18. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  19. Wholesale Trade
    Wholesale Trade
  20. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background
Armis Vulnerability Intelligence Database