Skip to content
Back to skills

Fix Cve Backport

ASecurity

Discover and fix CVEs in AI DIAL Chat dependencies or container images and backport fixes to the two newest release-X.Y branches. Automatically scan when no CVE or report is supplied. Use for vulnerability remediation with release backports, or to backport an existing security fix. Not a general dependency-upgrade workflow.

  • 501 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 9, 2026
testingpythongobashnodedockergitsecuritydocumentation

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add epam/ai-dial-chat --skill fix-cve-backport --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fix Cve Backport?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fix Cve Backport
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/epam-fix-cve-backport/badge)](https://www.skillsdirectory.com/skills/epam-fix-cve-backport)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: fix-cve-backport
description: Discover and fix CVEs in AI DIAL Chat dependencies or container images and backport fixes to the two newest release-X.Y branches. Automatically scan when no CVE or report is supplied. Use for vulnerability remediation with release backports, or to backport an existing security fix. Not a general dependency-upgrade workflow.
---

# Fix CVEs and backport to two releases

Discover vulnerabilities when no advisory is supplied, then prepare focused fixes
on `development` and independently validated backports to
the **two highest numeric `release-X.Y` branches on the chosen remote**. Published
releases, tags, commit dates, and local branch availability do not choose targets.
Discover the names on every run; never hardcode today's release versions.

## Scope and execution

- Accept CVE/GHSA identifiers, scanner findings, a package/image report, or an
  existing fix commit/PR. Reuse supplied details and ticket numbers. With no
  finding supplied, run automatic discovery after establishing branch snapshots;
  do not ask the user to provide a CVE identifier. With explicit findings, stay
  within that scope unless the user also requests a broader scan.
- A request to fix **and backport** authorizes topic branches, local commits, and
  cherry-picks. Complete these without another confirmation. A preview/plan-only
  or scan-only request produces a report without fixes, commits, or publication.
  Honor explicitly supplied source/target branches.
- Push and PR creation follow the user's requested scope. If requested, finish
  them without reconfirming. Otherwise finish with local branches/commits. Never
  merge, tag a release, publish an image, or push directly to development/release
  branches as part of this workflow. Topic names start with `fix/` or `backport/`.
- Keep unrelated edits intact. Work in separate worktrees with unique paths and
  branches. Inspect existing worktrees before reusing one; never stash, reset,
  clean, delete, or amend another task's work.

## 1. Establish branch snapshots

Read the repository's `AGENTS.md` and relevant path rules. For AI DIAL Chat, read
[references/ai-dial-chat.md](references/ai-dial-chat.md) for repository pitfalls.
Determine the Git root, intended remote, current worktrees, and working-tree
status. Default to `origin` when it is the repository's upstream; distinguish a
fork's push remote from the authoritative remote containing release branches.

For automatic target selection, run the bundled read-only helper:

```bash
python3 <skill-directory>/scripts/select_release_branches.py --repo <git-root> --remote <upstream-remote>
```

It queries the live remote and returns exactly two branch names, full refs, and
SHAs. A failure or fewer than two matching branches is a discovery blocker, not
permission to use stale local refs or invent a second target. Explain the blocker
and continue any independent investigation. Explicit user targets override the
automatic selection but still require remote existence/SHA checks.

Fetch the source base and each selected target by explicit branch refspec. Record
their fetched base SHAs. Check the selected targets still match the helper's
snapshot; if the remote advanced, refresh the snapshot before creating worktrees.
Announce the source base and both targets. Use these recorded SHAs for worktree
creation and verification. Do not silently change targets midway through a run.

### Automatic discovery

When no advisory/report was supplied, follow
[references/automatic-discovery.md](references/automatic-discovery.md). Scan the
source snapshot and both selected release snapshots independently, including
development dependencies and the applicable final container images. Collect a
baseline queue with advisory IDs, package/artifact locations, branch SHAs,
affected/fixed versions, and scanner coverage. A clean development scan does not
establish that the releases are clean.

Summarize the queue and continue fixing compatible findings, prioritizing
Critical/High severity. Group findings that share the same minimal dependency
update; retain every finding's outcome. Do not wait for the user to select a CVE
when the request already authorizes discovery, fixes, and backports. Unavailable
scanners, incompatible upgrades, and advisories without a fix remain explicit
blockers; continue independently actionable work. If discovery finds nothing,
report the scanned coverage and gaps without creating empty commits or PRs.

## 2. Establish the actual fix

Verify the advisory with current primary sources (maintainer/GHSA, vendor security
notice, official package or OS advisory). Record the URL, affected package and
version ranges, fixed ranges for each maintained line, and finding location.
Never interpret a list of fixed versions as one global minimum across majors.

Inspect **each branch separately**: relevant manifests, every resolved instance
in the lockfile, transitive parent chains, overrides, and Docker build/runtime
stages. Distinguish an npm dependency, bundled/global npm tool, OS package, and
base-image finding; each has a different remediation. A devDependency or missing
direct import alone does not prove a false positive.

Prefer the smallest compatible fixed release. Upgrade the owning direct
dependency when practical; use a narrow override for a transitive dependency only
after checking compatibility. Do not run blanket `npm audit fix --force`, upgrade
unrelated packages, weaken scanner policy, or add suppressions to claim a fix.
Use the branch's package-manager/Node versions and regenerate its lockfile.
For a source-code fix, add a focused regression test when it can verify the
security behavior. Do not create tests that merely assert a dependency version.

If no compatible fix exists, report the specific target as blocked and explain
whether a larger upgrade or mitigation is available. A proposed mitigation is
not an upstream patch; do not call an unresolved CVE fixed. Continue other targets
where safe and independently useful.

## 3. Produce or identify the source commit

Create `fix/<cve-or-ticket-slug>` from the fetched source base in its own worktree.
Make only the necessary fix and verify it using section 5. Stage explicit paths
and commit the security fix, recording the full SHA(s) in dependency order.

When given an existing commit/PR, inspect its real diff and prerequisites first.
For a merged PR use the resulting commit(s) on the base branch (including squash
SHA), not blindly the original PR head. Isolate the CVE changes when unrelated
work is included. For a merge commit establish the correct mainline from its
parents/diff or use equivalent ordinary commits; never guess `-m 1`.
An existing sufficient source fix needs no duplicate source commit.

If a discovered finding affects only a release and no applicable development fix
exists, record development as not affected. Implement and validate the minimal
fix on the newest affected target release, then use its real commit as the source
for another affected release when compatible. The originating release already
has the fix and needs no cherry-pick of its own commit. Record this provenance;
never manufacture an empty development commit or claim a development backport.

Follow the available repository `git-ship` skill for commit/PR conventions when
committing or publishing. Preserve this task's source/target bases, separate
worktrees, explicit file staging, and local-only/publish scope: its generic
development-base/push examples do not replace these choices. Reuse a known issue
number; never invent one. If repository rules require a missing ticket, ask for
it while continuing preparation that does not depend on the answer.

## 4. Backport independently

For each selected release, first inspect the current dependency/code state and
history. Classify it as affected, already fixed, not affected, or undetermined.
Commit ancestry/trailers and patch equivalence help find prior backports, but
verify the current tree too: an old fix may have been reverted. No-op targets
need evidence and a report row, not an empty commit/PR.

For an affected target, create `backport/<cve-or-ticket-slug>-release-X.Y` from its
recorded base SHA in a separate worktree, then apply the source commits in order:

```bash
git -C <target-worktree> cherry-pick -x <full-source-commit-sha>
```

Resolve conflicts using the release's existing architecture and dependency line.
Do not import development-only features, migrations, or prerequisite upgrades
unrelated to the fix. For lockfile conflicts, resolve manifests first, retain the
target's unrelated dependency graph, and regenerate with its package manager.
Never replace the release lockfile wholesale with development's lockfile. Inspect
the resulting dependency changes and unexpected churn before continuing.

For conflicts, stage only resolved task files, continue the cherry-pick, and
verify its final message retains `(cherry picked from commit <full-source-sha>)`.
If a clean cherry-pick still needs release-specific adjustment, add a focused
follow-up commit with provenance and explain the adaptation. When compatibility
requires a different patched version, preserve the security outcome, not an
identical version string.

An empty cherry-pick is not proof of success: verify the target state before
skipping it. If a conflict cannot be resolved confidently, abort only this task's
cherry-pick, retain the worktree, and report the blocker while finishing other
targets. Repeated tool/push failures require diagnosis, not blind retries or a
force-push. On reruns, inspect existing task branches/PRs and reuse valid work;
avoid duplicate commits/PRs or overwriting existing branches.

## 5. Verify each changed branch

Do not transfer a successful development result to either release. In each
worktree, read that branch's toolchain, CI checks, and Nx targets before running
them. Use the installed workspace tools through its package manager; consult
`nx-workspace`/`nx-run-tasks` when available.

- Confirm a reproducible lockfile install and check all affected resolved package
  copies against the advisory, including transitive/nested copies.
- Run the relevant test, typecheck, lint, and build checks required by that
  branch. Use the **recorded target base SHA** for affected selection, with the
  candidate committed HEAD. Check wrapper scripts for hardcoded development
  bases. Follow branch-required full checks when applicable.
- Re-run the original scanner against the same artifact and finding identifiers.
  Audit JSON, a lockfile scan, and a final-image scan are different evidence.
  For container findings, locally build the affected final image(s) and scan
  those outputs; do not publish them. Check generated production manifests when
  the build prunes/reinstalls dependencies. Include the requested CVE regardless
  of severity filters, suppressions, or ignore-unfixed settings.
- Distinguish a scanner's findings exit status from an execution/auth/network
  failure. Unrelated pre-existing findings do not imply this CVE is still present;
  an unavailable scanner does not prove it is gone. Report verification gaps.
- Review the final diff against that branch's base for scope, compatibility, and
  lockfile churn. Apply repository review/documentation gates when relevant.

After a commit/amend or conflict fix changes content, validate that resulting
content before reporting it as ready. Report passed/failed/unavailable checks
explicitly; do not label a partially verified backport fully verified.

## 6. Publish if requested and report

When push/PR work is authorized, check remote topic branches and existing PRs
before creating duplicates. Push only the task's topic refs. Set each PR's base
explicitly: source PR to `development` (or the chosen source base), backport PRs
to their respective release branches. Use repository PR templates and include
CVE links, source SHA/PR, branch-specific versions, adaptations, and check results.
Respect requested draft status; use draft PRs for known verification gaps.

Before publication, recheck target remote tips. If a target moved, inspect the
intervening changes and refresh/revalidate the candidate as needed; never imply
validation was performed against a newer base. Stop a rejected push for
diagnosis; do not force-push or bypass branch protection. Do not claim CI passed
without observing it; use `monitor-ci` when CI monitoring is requested.

Finish with a compact table for the source and both targets: base branch/SHA,
outcome (fixed / already fixed / not affected / blocked), topic branch and commit
SHA(s), validation results, and PR link if created. Include worktree paths for
local work and exact remaining blockers. A blocked or unverified target means
the overall task is partial, even if the other branches succeeded.
For automatic discovery, also report baseline finding outcomes and scan coverage
per branch/artifact, including unfixed, suppressed, and unverified findings.

Files in this skill

  • SKILL.md12.7 KB
  • agents/openai.yaml257 B
  • references/ai-dial-chat.md2.8 KB
  • references/automatic-discovery.md7 KB
  • scripts/select_release_branches.py3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.