<< All versions

Skill v1.0.2

currentAutomated scan100/100
openshift-eng/ai-helpers/analyze-cve-repos

~2 modified

──Details
PublishedNovember 24, 2026 at 07:17 AM
Content Hashsha256:481fabcaab1db2a1...
Git SHAca863b2508d2
Bump Typepatch
Compare with v1.0.1
──Files
Files (1 file, 15.7 KB)
SKILL.md15.7 KBactive
SKILL.md · 195 lines · 15.7 KB

name: analyze-cve-repos description: Analyze CVE reachability against downstream repository forks at version-specific release branches metadata: version: "1.0.2"


When to Use

Use this skill when Phase 2 of the node-cve:triage command needs to determine whether a CVE's vulnerable code path is actually reachable in a Node team repository. Each CVE is analyzed against the release branch (or, for upstream-only components, the shipped tag) that corresponds to the OCP version selected in Phase 1, one agent per CVE and repository. If the fork, branch or tag is not found, the CVE is classified as Uncertain for that repository.

Prerequisites

  • Repository already cloned or refreshed at .work/node-cve/repos/<owner>-<repo-name>-<branch>/ (the triage command does this before spawning parallel analysis agents)
  • Network access to GitHub (for CVE data)
  • The node-team plugin (shared component and version data)

Locating shared data and the helper script

The links to node-team files below resolve in a repository checkout and on the docs site. When the plugins are installed they do not resolve, because every plugin lives in its own versioned cache directory. Get the real directory from the helper script, then read the files from there with the Read tool:

bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/report-findings/scripts/node-cve-lib.sh" refs

The helper script is node-cve-lib.sh. It is the only Bash command this plugin needs, which keeps headless runs with a strict tool allowlist working. Do not write ad-hoc curl, jira or git commands and do not chain commands. Use the Read, Grep, Glob and Write tools for file work. Shell variables do not persist between Bash tool calls, so pass values as literal arguments.

Paths written as .work/node-cve/triage-YYYY-MM-DD/ stand for the run directory that init printed as TRIAGE_DIR=. Use that path as is, also after midnight; the helper keeps using it for the whole run.

If refs fails, invoke the node-team:node skill and read references/shared/ from its base directory. If the files still cannot be found, stop with "node-team shared references not found". Never fall back to data from memory.

Implementation Steps

Step 1: Map component to downstream repository and branch

Analysis must target the release branch corresponding to the selected OpenShift version. The main branch may have newer dependencies or Go versions that mask vulnerabilities present in shipped releases. Analysis targets the downstream fork, or the upstream repository at the shipped tag for the components the shared components reference maps upstream only (conmon-rs, cri-tools).

Component to repository mapping: Read the component-to-repo table and the pscomponent: label mapping from the node-team shared components reference. Trackers labeled pscomponent:crun or pscomponent:conmon are not analyzed: those packages belong to the containers team (see "Not owned by the Node team" there). Precedence for choosing the repository: if the tracker carries a pscomponent: label listed in the label mapping table, the label wins. Otherwise use the row for the tracker's Jira component. A row that lists two repositories (Node / Kueue: the operand openshift/kubernetes-sigs-kueue and the operator openshift/kueue-operator) needs a choice: pick the repository from the affected package or image named in the tracker summary or description, following the Kueue note in the components reference, and classify as Uncertain with note "component maps to more than one repository" if it stays ambiguous. A bare Node component without a usable label does not identify a repository. In that case use the package named in the tracker summary (the text between the CVE ID and the colon, for example cri-o:) to pick a row, and if that is still ambiguous classify as Uncertain with note "component does not map to a repository".

Version mapping: Read the formulas and the branch naming conventions from the node-team shared version map and derive the release branch from them. The map is the only source. Do not apply a formula from memory, since OCP 4.Y and OCP 5.Y use different ones.

If the component does not map to a known repo, classify as Uncertain and skip analysis. If the downstream fork or release branch does not exist, classify as Uncertain with note "downstream fork/branch not found" and skip analysis.

Step 2: Verify repository and branch

The triage command clones or refreshes the repository with the helper before this skill runs and passes on the DIR= and COMMIT= values it printed (directory, short commit hash and commit date). Record the commit in the evidence. If this skill runs on its own, do the same:

bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/report-findings/scripts/node-cve-lib.sh" clone https://github.com/openshift/cri-o release-5.0

The second argument is a release branch or a tag. Components that shared/components.md maps to upstream tags (conmon-rs, cri-tools) are cloned at the tag that ships in the selected OCP version, for example clone https://github.com/containers/conmon-rs v0.6.6.

Exit code 3 means the fork or branch does not exist: classify as Uncertain with note "downstream fork/branch not found". Exit code 4 means the clone failed although the branch exists: classify as Uncertain with note "clone failed". An existing directory is always refreshed to the branch tip, so a stale clone is never analyzed.

Step 3: Gather CVE intelligence

Fetch vulnerability details to understand what to look for in the source code:

  1. Extract the CVE ID from the Jira issue summary.
  2. Search for vulnerability details from public sources:
  • Search the web for the CVE ID to find advisories, affected packages, vulnerable functions, and fixed versions
  • Check the Jira issue description and comments for additional context (affected package, vulnerable API, attack vector). The helper returns them as JSON:

``bash bash "${CLAUDE_PLUGIN_ROOT}/skills/report-findings/scripts/node-cve-lib.sh" issue OCPBUGS-XXXXX ``

  1. Build a vulnerability profile:
  • Affected package/library: the specific dependency or stdlib package (e.g., golang.org/x/net/html, crypto/x509, capnproto.org/go/capnp)
  • Vulnerable functions/methods: specific API surface that triggers the vulnerability (e.g., html.Parse, x509.ParseCertificate)
  • Attack vector: how the vulnerability is exploited (e.g., malicious input, crafted certificate, oversized allocation)
  • Fixed version: version where the fix was applied

If vulnerability details cannot be determined, classify as Uncertain with note "insufficient CVE details available".

Step 4: Check whether the affected code is present

First decide which kind of package the CVE affects. The check differs, and using the wrong one produces false "Unaffected" results.

4a. Go standard library or Go toolchain CVE (the affected package has no domain in its import path, for example crypto/x509, net/http, archive/tar, or the CVE is against cmd/go or the runtime):

Standard library packages never appear in go.mod, go.sum, or vendor/modules.txt. Never classify a stdlib CVE as Unaffected because it is missing from those files. What matters is the Go version the shipped binary is built with. Look it up with the Read and Grep tools inside the repo directory:

  • Read go.mod and note the go and toolchain directives.
  • Grep for the builder image: pattern golang[-:_]?[0-9]+\.[0-9]+|GO_VERSION|go-toolset|build_root_image with the globs Dockerfile*, *.Dockerfile, .ci-operator.yaml and *.spec.
  • The go directive is a minimum language version and toolchain a suggested one. The builder image (.ci-operator.yaml build_root_image, FROM lines in Dockerfile*, openshift/ or images/ directories) decides what actually compiles the release binary. Prefer it as evidence.
  • Toolchain switching: with GOTOOLCHAIN=auto, a go or toolchain directive newer than the builder makes go download and use that newer toolchain. Downstream release builds run offline with RHEL go-toolset, which sets GOTOOLCHAIN=local, so the builder version counts. Only use the directive version instead when the build sets GOTOOLCHAIN to something other than local (grep for GOTOOLCHAIN with the same globs), and say so in the evidence.
  • Compare the builder Go version with the fixed Go version from Step 3. If the builder version is at or above the fix: Unaffected, with the builder version as evidence. If it is below the fix, or cannot be determined: the vulnerable code is present. Continue to Step 5 to decide reachability. If the version cannot be determined at all, the confidence is at most Medium.

4b. Third-party Go module: Grep for the module path (for example golang.org/x/net), not the package path (golang.org/x/net/html), in go.mod, go.sum and vendor/modules.txt, since dependency files list modules. If present, compare the version with the fixed version. At or above the fix: Unaffected with the version as evidence. Repos with several go.mod files (for example staging/ in openshift/kubernetes) need each relevant file checked.

4c. Rust repos (conmon-rs): check Cargo.toml and Cargo.lock.

Only for 4b and 4c: if the affected package is not in the dependency tree at all, classify as Unaffected with high confidence and continue with the next CVE.

Step 5: Analyze source code for reachability

This is the core analysis step. Read the repository source code to determine if the vulnerable code path is actually exercised.

  1. Find imports and usage of the affected package with the Grep tool, scoped to the repo directory:
  • Go: search for the quoted import path as a fixed string, for example "crypto/x509", with glob *.go. Go import blocks list one quoted path per line without the word import, so a pattern like import.*<pkg> misses most imports. The quoted path matches single imports, import blocks and aliased imports.
  • Rust: use <crate>(::|;) with glob *.rs.
  • Call sites: search for the vulnerable function name (for example x509.ParseCertificate, or the alias used in that file) across *.go and *.rs.

Ignore test-only code: _test.go files in Go, and in Rust #[cfg(test)] modules, tests/ and benches/ directories. Tests alone do not make a CVE reachable. Separate first-party code from vendor/. A vulnerable function that is only called from inside a vendored dependency still counts, but the call path must then be traced from first-party code into that dependency.

  1. Read the files that use the affected package. For each call site:
  • Is the vulnerable function called directly?
  • Is it called through a wrapper or interface?
  • What data flows into the vulnerable function? Is it attacker-controlled (network input, user-supplied files, untrusted certificates) or internal/trusted?
  1. Trace the call path from entry points (main, HTTP handlers, gRPC servers, CLI commands) to the vulnerable function. Determine if the path is reachable in normal operation.
  1. Check for mitigating controls:
  • Input validation or sanitization before the vulnerable function
  • Size limits, timeouts, or rate limiting that prevent exploitation
  • Feature flags or configuration that disable the vulnerable code path
  • Network policies or authentication that restrict access to the attack vector
  1. Assess exploitability in context:
  • Is the vulnerable function exposed to untrusted input?
  • Does the deployment context (OpenShift node, privileged container) increase or decrease risk?
  • Are there compensating controls at the platform level?

Step 6: Classify result

Use exactly one of these classification values. The enum value is what goes into JSON output, the label is what goes into reports, Jira comments and Slack:

FindingEnum valueLabelConfidence
Vulnerable function called with attacker-controlled input, no mitigationsREACHABLEReachableHIGH
Vulnerable function called, but input is partially validatedREACHABLEReachableMEDIUM
Vulnerable function called, but only with trusted/internal dataPRESENT_NOT_EXPLOITABLEPresent but not exploitableHIGH
Package imported (or stdlib version vulnerable) but vulnerable function not calledPRESENT_NOT_REACHABLEPresent but not reachableHIGH
Third-party package not in dependency tree, or dependency / Go toolchain version already contains the fixUNAFFECTEDUnaffectedHIGH
Repo too large to fully analyze, CVE details insufficient, fork/branch missing, clone failed, or Go builder version unknown and no call sites foundUNCERTAINUncertainLOW

Confidence is one of HIGH, MEDIUM, LOW. Lower it by one level whenever the analysis was incomplete (call paths not fully traced, builder Go version inferred rather than read).

Step 7: Build evidence summary

Write a concise analysis for the report:

  • Repository, branch and analyzed commit (the COMMIT= value from Step 2)
  • For stdlib CVEs: the Go version found, where it was found, and the fixed version
  • Which files import/use the affected package (with file paths and line numbers)
  • Whether the vulnerable function is called and from where
  • The call path from entry point to vulnerable function (if reachable)
  • What input reaches the vulnerable function and whether it is attacker-controlled
  • Any mitigating controls found
  • Recommended action (update dependency, apply patch, accept risk, investigate further)

Save the analysis with the Write tool to <TRIAGE_DIR>/<CVE-ID>-<owner>-<repo>-<ref>-analysis.md (for example CVE-2025-61729-openshift-cri-o-release-5.0-analysis.md), so the same CVE analyzed against two repositories gets two files. Start the file with a line Classification: <label> (<confidence>), so later runs can reuse it from the cache.

Return Value

json
{
"skill": "analyze-cve-repos",
"cve_id": "CVE-2026-32281",
"repo": "https://github.com/openshift/cri-o",
"branch": "release-5.0",
"commit": "abc1234",
"ocp_version": "5.0",
"classification": "REACHABLE",
"confidence": "HIGH",
"evidence": {
"affected_package": "crypto/x509",
"package_kind": "go-stdlib",
"go_version_found": "1.25.3 (build_root_image in .ci-operator.yaml)",
"vulnerable_function": "x509.ParseCertificate",
"call_sites": [
"pkg/server/tls.go:42 - called from TLS handshake path",
"pkg/server/auth.go:118 - called during client cert validation"
],
"call_path": "main -> server.New -> setupTLS -> x509.ParseCertificate",
"input_source": "network (client TLS certificates, attacker-controlled)",
"mitigations": "none found",
"fixed_version": "go1.25.5"
},
"remediation_hint": "Update the Go builder image to 1.25.5 or later. Vulnerable function processes untrusted client certificates during TLS handshake."
}

The values above are illustrative. classification is one of the enum values from Step 6, confidence one of HIGH, MEDIUM, LOW, and package_kind one of go-stdlib, go-module, rust-crate.

Error Handling

  • Fork or branch missing: classify as Uncertain with note "downstream fork/branch not found", continue to next CVE
  • Clone or fetch failure on an existing branch: classify as Uncertain with note "clone failed: <error>", continue to next CVE
  • node-team shared references not found: stop with an error, do not guess the mapping
  • CVE details unavailable: classify as Uncertain with note "could not determine affected package/function"
  • Repo too large to fully trace call paths: focus on direct imports and obvious call sites, note incomplete analysis in evidence
  • Permission errors: ensure the work directory is writable
← v1.0.1All versions