Log4j Vulnerability Demo and Fix
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=ziZnU3t-DRM
Code: https://www.srccodes.com/apache-log4j... • In this video, I have shared following • What is Apache Log4j2 Vulnerability (CVE-2021-44228, CVE-2021-45046 and CVE-2021-45105) ? • How to reproduce using Sprint Boot log4j ? • Different ways to mitigate this? • How to mitigate this vulnerability ? • ***Update: Use Log4j 2.17.0 to address Log4j vulnerability*** • Reference: https://logging.apache.org/log4j/2.x/... • Mitigation: • ------------------ • Log4j 1.x mitigation: Log4j 1.x is not impacted by this vulnerability. • Log4j 2.x mitigation: Implement one of the mitigation techniques below. • Java 8 (or later) users should upgrade to release 2.17.0. • Alternatively, this can be mitigated in configuration: • In PatternLayout in the logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC). • Otherwise, in the configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input. • Note that only the log4j-core JAR file is impacted by this vulnerability. Applications using only the log4j-api JAR file without the log4j-core JAR file are not impacted by this vulnerability. • Also note that Apache Log4j is the only Logging Services subproject affected by this vulnerability. Other projects like Log4net and Log4cxx are not impacted by this. • Reference: https://cve.mitre.org/cgi-bin/cvename... • Apache Log4j2 versions 2.0-alpha1 through 2.16.0 (excluding 2.12.3) did not protect from uncontrolled recursion from self-referential lookups. This allows an attacker with control over Thread Context Map data to cause a denial of service when a crafted string is interpreted. This issue was fixed in Log4j 2.17.0 and 2.12.3. • Reference: https://cve.mitre.org/cgi-bin/cvename... • It was found that the fix to address CVE-2021-44228 in Apache Log4j 2.15.0 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 2.15.0 makes a best-effort attempt to restrict JNDI LDAP lookups to localhost by default. Log4j 2.16.0 fixes this issue by removing support for message lookup patterns and disabling JNDI functionality by default. • Reference: https://cve.mitre.org/cgi-bin/cvename... • Apache Log4j2 2.0-beta9 through 2.12.1 and 2.13.0 through 2.15.0 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default. From version 2.16.0, this functionality has been completely removed. Note that this vulnerability is specific to log4j-core and does not affect log4net, log4cxx, or other Apache Logging Services projects. • #log4j2 #CVE-2021-44228 #Vulnerabilities #log4j #CVE-2021-45046 • ~~~~~~~~~~~~~~~~~~~~~ • For more tutorials subscribe follow • Youtube: https://bit.ly/srccodes • Facebook: / srccodes • Twitter: https://twitter.com/intent/follow?sou... • Website: https://www.srccodes.com • Please Like and Subscribe to support this channel.
#############################
