From null-ptr-exception-skills
Scan a container image for CVEs with Trivy and patch what can be fixed locally. Use when the user asks to "fix CVEs", "scan for vulnerabilities", or points at a Dockerfile / image tag and wants it hardened. Default scope is CRITICAL only; include HIGH only when the user asks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/null-ptr-exception-skills:fix-cveThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scan a container image and apply minimal Dockerfile changes to resolve fixable CVEs. Stop before committing — git is out of scope.
Scan a container image and apply minimal Dockerfile changes to resolve fixable CVEs. Stop before committing — git is out of scope.
trivy image). Install if missing (consult official docs for the platform).<name>-cve-test), then scan.Redirect full output to a temp file (needed for investigation if something looks off), then summarise.
trivy image --severity CRITICAL --quiet <image> > /tmp/trivy.log 2>&1
Add HIGH to the severity filter only when requested.
For every CVE, place it in one of two buckets:
A. Locally fixable — the vulnerable package can be upgraded in our Dockerfile:
apk package with a fixed version available → apk upgrade <pkg> or apk add <pkg>=<fixed-ver>apt package with a fixed version → apt-get install -y <pkg>=<fixed-ver>curl at a pinned version → bump the pinned versionB. Upstream-only — compiled into a vendor binary (Go stdlib, vendored Go/Rust deps inside a prebuilt binary like gitlab-runner, helm, etc.):
Edit the Dockerfile with the smallest possible change:
apk upgrade expat) over blanket apk upgrade.RUN layout, alphabetical package ordering where the file already uses it.Rebuild and rescan:
docker build -q -t <name>-cve-test <context>
trivy image --severity CRITICAL --quiet <name>-cve-test
Confirm the fixable CVEs are gone.
Present two sections to the user:
Fixed — list of CVEs patched, with the Dockerfile lines added.
Waiver candidates (upstream-only, base already latest) — as a markdown table:
| CVE | Package | Installed | Fixed in | Status |
|---|---|---|---|---|
| CVE-XXXX-YYYYY | pkg-name | x.y.z | a.b.c | Compiled into vendor binary; awaits upstream rebuild |
Include a one-line Justification stating the base image is already on the latest upstream release (with version + release date).
Do not git add or git commit. End with "Ready to commit — review and commit when you're happy."
apk upgrade with no package list unless the user asks — it bloats the image and obscures what changed.npx claudepluginhub null-ptr-exception/skills --plugin null-ptr-exception-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.