Afrouper/MavenDependencyCVE-Scanner

GitHub: Afrouper/MavenDependencyCVE-Scanner

一款轻量级的 Maven 依赖漏洞扫描器,用于检测项目目录中是否存在受指定 CVE 影响的 JAR/WAR/EAR 组件。

Stars: 1 | Forks: 0

# 简易 Maven 依赖漏洞扫描器 [![当前发布版本](https://badgen.net/github/release/Afrouper/MavenDependencyCVE-Scanner?icon=github)](https://github.com/Afrouper/MavenDependencyCVE-Scanner/releases/latest) [![使用 Maven 的 Java CI](https://github.com/Afrouper/MavenDependencyCVE-Scanner/actions/workflows/maven.yml/badge.svg)](https://github.com/Afrouper/MavenDependencyCVE-Scanner/actions/workflows/maven.yml) [![构建发布版本](https://github.com/Afrouper/MavenDependencyCVE-Scanner/actions/workflows/buildAndRelease.yml/badge.svg)](https://github.com/Afrouper/MavenDependencyCVE-Scanner/actions/workflows/buildAndRelease.yml) [![发布](https://badgen.net/github/releases/Afrouper/MavenDependencyCVE-Scanner)](https://github.com/Afrouper/MavenDependencyCVE-Scanner/releases) [![CodeQL](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/25a2ad4d15115417.svg)](https://github.com/Afrouper/MavenDependencyCVE-Scanner/actions/workflows/codeql-analysis.yml) ![许可证](https://badgen.net/github/license/Afrouper/MavenDependencyCVE-Scanner) 灵感来源于 [logpresso Scanner](https://github.com/logpresso/CVE-2021-44228-Scanner),我也在其中贡献了一些 代码 :-) 而且我还需要使用 GitHub Actions 进行一些自动构建和发布... ## 构建 只需简单检出并使用 `mvn package` 构建。可以通过 `mvn package -Pnative` 创建 GraalVM native-image。必须安装带有 native-image 的 [GraalVM](https://www.graalvm.org)。 ### 自动版本控制 本项目使用 [Maven Git Versioning Extension](https://github.com/qoomon/maven-git-versioning-extension) 来 自动设置版本号。为了获得无瑕疵的体验,您需要在 IntelliJ 中导入项目时禁用此扩展。 通过向 Maven Importer VM options 添加 `-Dversioning.disable=true` 来禁用它。 ## 执行 在 release 部分您可以找到适用于所有 JRE 8+ 环境的 JAR 文件。您还可以下载适用于 linux、macOS 或 windows 的原生二进制文件。 要执行扫描器,只需调用 `java -jar CVE_MavenScanner-.jar -cve scanPath`,其中 'scanPath' 是您想要扫描的目录。目录中的所有 ZIP、JAR、WAR 和 EAR 文件都会被扫描(同时也支持 Fat-JAR)。此外所有 目录都会被递归扫描。无需安装 Java 即可执行原生二进制文件 - 请为您的系统 选择正确的版本。 如果在调用时不带任何参数,将列出所有可用的 CVE **注意:** 下载 macOS 二进制文件后,您可能需要移除隔离属性。请 通过 `xattr -d com.apple.quarantine CVE_MavenScanner-mac-amd64` 执行此操作。 如果一切正常,您将获得返回代码 `0`,如果发现任何问题则为 `> 1`。 ### 示例输出 ``` Scan for CVE-2022-42889 Findings: 4 [-] ✅ org.apache.commons:commons-text:1.10.0 in Log4j-Scanner/src/test/resources/commons-text/commons-text-1.10.0.jar [*] 🔥 org.apache.commons:commons-text:1.9 in Log4j-Scanner/src/test/resources/commons-text/commons-text-1.9.jar [*] 🔥 org.apache.commons:commons-text:1.8 in Log4j-Scanner/src/test/resources/commons-text/commons-text-1.8.jar [?] ❓ null in Log4j-Scanner/src/test/resources/commons-text/commons-text_potentially.jar Process finished with exit code 3 ```
标签:JS文件枚举, Maven, 依赖安全, 加密, 域名枚举, 漏洞扫描器, 漏洞验证, 配置审计