بنقرة واحدة
maven-vuln-fix
Query and fix Maven dependency vulnerabilities reported by GitHub Dependabot using OSV API
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Query and fix Maven dependency vulnerabilities reported by GitHub Dependabot using OSV API
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | maven-vuln-fix |
| description | Query and fix Maven dependency vulnerabilities reported by GitHub Dependabot using OSV API |
| source | auto-skill |
| extracted_at | 2026-06-22T02:45:26.806Z |
When GitHub reports Dependabot vulnerabilities on a Maven project, the security page often requires authentication to view details. Use the OSV (Open Source Vulnerabilities) API to identify and fix them.
mvn dependency:tree 2>&1 | grep -v '^\[INFO\] ---' | grep -v 'BUILD'
For each dependency in pom.xml, query the OSV API:
curl -s -X POST https://api.osv.dev/v1/query \
-H "Content-Type: application/json" \
-d '{"package":{"name":"<groupId>:<artifactId>","ecosystem":"Maven"},"version":"<version>"}' \
| python3 -m json.tool
{} response means no known vulnerabilities."vulns" array contains CVE details, affected versions, and the "fixed" version.for pkg in "groupId:artifactId:version" ...; do
name=$(echo $pkg | cut -d: -f1,2)
ver=$(echo $pkg | cut -d: -f3)
result=$(curl -s -X POST https://api.osv.dev/v1/query \
-H "Content-Type: application/json" \
-d "{\"package\":{\"name\":\"$name\",\"ecosystem\":\"Maven\"},\"version\":\"$ver\"}")
if [ "$result" != "{}" ]; then
echo "=== VULNERABLE: $name:$ver ==="
echo "$result" | python3 -m json.tool | head -40
fi
done
Edit pom.xml to bump each vulnerable dependency to its "fixed" version from the OSV response.
mvn clean compile
mvn test
If ~/.m2/settings.xml uses http://maven.aliyun.com/nexus/content/groups/public (HTTP, not HTTPS), new artifacts may return 403 Forbidden. Fix by changing the mirror URL to HTTPS:
<url>https://maven.aliyun.com/nexus/content/groups/public</url>
Or temporarily use a custom settings file:
mvn clean compile -s /path/to/https-settings.xml
| Field | Meaning |
|---|---|
aliases | CVE identifiers (e.g., CVE-2025-7962) |
summary | Short description |
database_specific.severity | MODERATE, HIGH, CRITICAL |
affected[].ranges[].events | introduced and fixed version pairs |