检测 gradle 传递依赖项中是否存在 Apache Log4j 漏洞

问题描述 投票:0回答:2

log4j 中最近存在一个漏洞 https://nvd.nist.gov/vuln/detail/CVE-2021-44228 其严重程度得分为 10

如何检查 gradle 中是否存在 Log4j 易受攻击的版本,以便列出所有依赖项,包括传递依赖项?

java gradle log4j log4j2
2个回答
3
投票

我们可以使用

./gradlew -q dependencies

列出依赖树。它将列出所有依赖项及其各自的版本。由于此输出可能很长,我们可以使用

grep
:

对其进行过滤
./gradlew -q dependencies | grep -i log4j

这将列出所有

log4j
依赖项及其各自的版本。


1
投票
gradle -q dependencyInsight --dependency org.apache.logging.log4j 
 --configuration scm

还有另一种方法可以根据文章使用 dependencyInsight 检查此列表:- https://venturebeat.com/2021/12/17/how-to-detect-whether-you-have-the-log4j2-vulnerability/

© www.soinside.com 2019 - 2024. All rights reserved.