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

Focus on What Matters

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

Let's talk!

background