很多朋友发现自己在导入maven中的依赖后有些依赖会变黄;
那么为什么会出现这种情况呢?
出现这种情况是因为你的依赖的jar包在这个版本有漏洞,你点击之后就能看见详细的漏洞信息;
Dependency log4j:log4j:1.2.17 is vulnerable
CVE-2019-17571 9.8 Deserialization of Untrusted Data vulnerability pending CVSS allocation
CVE-2021-4104 7.5 Deserialization of Untrusted Data vulnerability with medium severity found
CVE-2022-23302 8.8 Deserialization of Untrusted Data vulnerability pending CVSS allocation
CVE-2022-23305 9.8 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability pending CVSS allocation
CVE-2022-23307 8.8 Deserialization of Untrusted Data vulnerability pending CVSS allocation
Results powered by Checkmarx(c)
那么如何解决这个问题呢?有两种方式:
- 上https://mvnrepository.com/中查找没有漏洞的版本进行添加;
- 在setting中的Editor下找到Inspections中找到Security | Vulnerable declared dependency,将其勾选去掉就可以。
这样就可以了,还有就是版本号下面波浪线也可以取消了,在Inspections中找到Package Search,在这个下面有一个Package Search | Check for new dependency versions (Maven)取消就可以了
欢迎大家指正,如果对大家有帮助请点赞转发。