AGENT SKILL

cve-known-vulnerabilities

Detect known CVEs in Maven, NuGet, or npm dependencies using the GitHub Security Advisories API

License 许可
MIT
最近更新
2026-09-24
Stars
★ 55
Forks
15

01 前言 Front Matter

name
cve-known-vulnerabilities
description
Detect known CVEs in Maven, NuGet, or npm dependencies using the GitHub Security Advisories API
user-invocable
false

02 资源文件 1

03 SKILL.md 正文

Local CVE Dependency Assessment

Audit dependencies without modifying application files. Do not call an assessment or CVE MCP tool.

Inputs

  • workspace-path: Absolute project root.
  • output-path: Required JSON result path supplied by the assessment catalog.
  • scan-scope: direct (default) or all.

1. Detect Ecosystem

  • Maven/Gradle project → advisory ecosystem maven.
  • .sln, .slnx, or project files → nuget.
  • package.json → npm.
  • If none apply, write [] to output-path and stop.

2. Collect Dependencies

Prefer project wrappers and structured command output. Never edit manifests or lock files.

Maven/Gradle

  • Maven: run ./mvnw dependency:list -DoutputAbsoluteArtifactId=true; add -DexcludeTransitive=true for direct scope. Fall back to mvn, then static pom.xml parsing.
  • Gradle: run ./gradlew dependencies --configuration runtimeClasspath; fall back to gradle, then static build.gradle/build.gradle.kts parsing.
  • Coordinate format: groupId:artifactId:version.

NuGet

  • Run dotnet list package --format json; add --include-transitive for all scope.
  • If no solution exists at the root, target each discovered project explicitly.
  • Fall back to PackageReference, Directory.Packages.props, and packages.config parsing.
  • Coordinate format: PackageName@version.

npm

  • Run npm list --json; add --depth=0 for direct scope.
  • Fall back to package-lock.json, yarn.lock, pnpm-lock.yaml, then package.json.
  • Coordinate format: package-name@version.

For each dependency retain its manifest path and 1-based declaration line when directly declared; use line 0 for transitive dependencies.

3. Query GitHub Advisories

Batch coordinates in groups of at most 30. Use gh api when available:

/advisories?ecosystem=<maven|nuget|npm>&affects=<url-encoded-coordinates>&per_page=100

Follow pagination. If gh is unavailable, use the GitHub REST API with GITHUB_TOKEN when present. Never use general web search for vulnerability conclusions.

If one batch fails, record the error and continue remaining batches. A failed query must not silently become a clean scan: return a wrapper with status: partial and the failed batch details instead of [].

4. Normalize Results

  • Ignore withdrawn advisories.
  • Use cve_id, falling back to ghsa_id.
  • Deduplicate the same advisory across dependency batches.
  • Map severity: critical/high → mandatory; medium → optional; low/unknown → potential.
  • Group all affected dependencies for one advisory into one finding.
  • Include advisory URL, vulnerable range, first patched version, and manifest evidence.

Output

On a complete scan, write a flat JSON array to output-path; use [] only when every query succeeded and no vulnerability was found:

[
  {
    "id": "CVE-2024-0001",
    "name": "Advisory summary",
    "status": "FOUND",
    "category": "CVE",
    "severity": "mandatory",
    "storyPoint": 1,
    "evidence": {
      "files": ["pom.xml:42"],
      "explanation": "Advisory URL, affected coordinates, vulnerable range, and patched version"
    }
  }
]

When any advisory batch fails, write:

{
  "input_name": "CVE dependency assessment",
  "analysis_method": "GitHub Security Advisories API",
  "status": "partial",
  "result": {
    "finding": "CVE scan completed with one or more failed advisory batches",
    "confidence": "low",
    "evidence": ["<failure details>"],
    "values": ["<all successfully returned FOUND findings>"]
  }
}

Write the output exactly once using a temporary file followed by atomic rename. Return only the output path and concise counts to the parent assessment.

04 同仓库更多 Skills

microsoft
microsoft/github-copilot-modernization

verify-test-baseline

Generate and run post-migration tests from the frozen baseline specification.

测试与质量
★ 55
microsoft
microsoft/github-copilot-modernization

team-request

How team members request infrastructure connection info and handle secrets in team mode

★ 55
microsoft
microsoft/github-copilot-modernization

team-charters

Provides role charters (mission, ownership, core principles, quality bar) for a multi-agent coding team. Each charter defines the role's mission, ownership scope, core principle (boundary constraints), and quality bar. Most roles also include communication rules. Consumed by the coordinator during task decomposition to assign work to the correct role. Triggers: "look up role charter", "what does the architect own", "check role boundaries", "find team roles", "which role handles X", "list agent charters", "role responsibilities". NOT for: task decomposition (use breaking-down-tasks), implementation (use implementing-code), architecture analysis (use analyzing-architecture).

★ 55
microsoft
microsoft/github-copilot-modernization

struts-to-spring

Migration guideline for transforming Apache Struts 2 applications to Spring Boot 3.x and Spring MVC.

★ 55
microsoft
microsoft/github-copilot-modernization

spring-boot-scaffolding

Reference guide for creating a new Spring Boot project during rewrite migration.

★ 55
microsoft
microsoft/github-copilot-modernization

sharing-learnings

How to record project learnings so that later-phase workers and future agent runs can consume them.

★ 55