Skill v1.0.0
currentAutomated scan100/100name: batch-cve-fix description: Combine all open CVE/Security issues (≤15) for a project into one branch and one PR. Upgrades all vulnerable packages in a single bulk commit. Run before any normal issue loop iteration. argument-hint: "[project-name] (e.g., che-dashboard)" metadata: version: "1.0.0"
Batch CVE Fix
Purpose
Groups multiple open CVE/Security dependency-upgrade issues into one branch, one commit, one PR — matching the pattern at https://github.com/eclipse-che/che-dashboard/pull/1662.
Run this skill before the normal run-loop pick cycle whenever the project has 2 or more open CVE/Security issues.
Phase 1: Detect CVE Issues
1.1 Query open CVE/Security issues
# Via agent API (returns issues sorted by score DESC):curl -s "http://localhost:3000/api/sources/issues?status=open&limit=50" | \python3 -c "import sys, jsonissues = json.load(sys.stdin)cves = [i for i in issues if'Security' in (i.get('labels') or []) or'security' in (i.get('labels') or []) or'CVE-' in i.get('title','')]print(f'CVE issues found: {len(cves)}')for i in cves:print(f\" {i['external_id']} | {i['title'][:60]} | score={i['score']}\")"
If 0 CVE issues → stop, run normal run-loop. If 1 CVE issue → run normal run-loop for that single issue. If 2–15 CVE issues → proceed with this batch skill. If ≥16 CVE issues → run this skill multiple times, 15 issues per batch.
1.2 Verify all issues are dependency upgrades
Each CVE issue title should match: "Upgrade <package>…", "CVE-YYYY-NNNNN … <package>", or contain a package name and version number.
If an issue requires source code changes (not just a version bump), exclude it from the batch and handle separately via run-loop.
Phase 2: Extract Package Upgrades
For each CVE issue, extract:
| Field | Where to find it | |
|---|---|---|
| Package name | Issue title — word after "Upgrade" or before CVE ID | |
| Target version | Issue title — "to version X.Y.Z" or "to X.Y.Z" | |
| npm latest | npm info <package> version if no version in title |
import redef parse_upgrade(title):# "Upgrade fastify to 5.2.1"# "CVE-2026-84469 fastify: Header validation bypass — upgrade to 5.x"pkg_match = re.search(r'upgrad\w+\s+([\w@/-]+)', title, re.I)ver_match = re.search(r'\bto\s+(?:version\s+)?([\d]+\.[\d]+\.[\d]+)', title, re.I)pkg = pkg_match.group(1).lower() if pkg_match else Nonever = ver_match.group(1) if ver_match else Nonereturn pkg, ver
If version is missing → resolve from npm:
npm info <package> version
Phase 3: Trigger Batch Run via API
# This picks all CVE issues automatically and starts one run:RESULT=$(curl -s -X POST http://localhost:3000/api/runs/cve-batch)echo $RESULT | python3 -c "import sys, jsond = json.load(sys.stdin)print('Thread:', d['threadId'])print('Issues:', d['count'])for i in d.get('issues', []):print(' -', i.get('title','')[:60])"
Monitor the run:
THREAD_ID=<from above>curl -s "http://localhost:3000/api/runs/${THREAD_ID}" | \python3 -c "import sys,json; d=json.load(sys.stdin); print(d['status'], d.get('messages',[''])[-1])"
Phase 4: Manual Implementation (if API is not available)
If running without the API, implement manually:
4.1 Create batch branch
PROJECT=<project-name from context.md local_path>cd $PROJECTgit checkout main && git pullBRANCH="cve-batch-$(date +%Y%m%d)-deps"git checkout -b $BRANCH
4.2 Bump all vulnerable packages
# For each package extracted in Phase 2:# (repeat for each CVE package)PACKAGE=fastifyVERSION=5.2.1 # or: VERSION=$(npm info $PACKAGE version)# Update package.json (finds all occurrences in monorepo):find . -name "package.json" -not -path "*/node_modules/*" | \xargs grep -l "\"${PACKAGE}\"" | \xargs python3 -c "import sys, json, refor path in sys.argv[1:]:with open(path) as f:pkg = json.load(f)changed = Falsefor section in ['dependencies', 'devDependencies', 'peerDependencies']:if section in pkg and '${PACKAGE}' in pkg[section]:pkg[section]['${PACKAGE}'] = '^${VERSION}'changed = Trueif changed:with open(path, 'w') as f:json.dump(pkg, f, indent=2)f.write('\n')print('Updated:', path)" $(find . -name "package.json" -not -path "*/node_modules/*")
4.3 Install and verify
yarn install --silentyarn buildyarn test
4.4 Commit
# Replace with actual CVE keys and packages:git add package.json packages/*/package.json yarn.lockgit commit -m "fix(deps): batch CVE fixes — CRW-12921, CRW-12931, CRW-12925Upgrades to address:- CRW-12921 / CVE-2026-84469: fastify → 5.2.1- CRW-12931 / CVE-2026-19534: undici → 7.3.0- CRW-12925 / CVE-2026-84428: @fastify/cors → 11.0.1Assisted-by: Claude Sonnet 4.6Signed-off-by: ..."
4.5 Open PR
REPO=eclipse-che/che-dashboardgh pr create --repo $REPO \--title "fix(deps): batch CVE fixes — CRW-12921, CRW-12931, CRW-12925 (3 packages)" \--body "$(cat <<'EOF'## SummaryBatch upgrade of vulnerable npm dependencies to address 3 CVE issues.## CVEs Fixed| Jira | CVE | Package | Old | New ||---|---|---|---|---|| [CRW-12921](https://redhat.atlassian.net/browse/CRW-12921) | CVE-2026-84469 | fastify | 4.x | 5.2.1 || [CRW-12931](https://redhat.atlassian.net/browse/CRW-12931) | CVE-2026-19534 | undici | 6.x | 7.3.0 || [CRW-12925](https://redhat.atlassian.net/browse/CRW-12925) | CVE-2026-84428 | @fastify/cors | 10.x | 11.0.1 |## Test plan- [ ] `yarn build` passes- [ ] `yarn test` passes- [ ] No breaking API changes (only patch/minor bumps)Resolves CRW-12921, CRW-12931, CRW-12925EOF)"
Phase 5: Monitor CI and Review
Same as run-loop Phase 5–6:
gh pr checks <PR_NUM> --repo $REPO --watch
If CI fails on a specific package bump:
- Check the failure:
gh run view --log-failed - If the bump introduced a breaking change, revert that package to the previous version and re-run
- Open a separate PR for the problematic package with source code fixes
Output Report
## Batch CVE Fix Complete**Project:** che-dashboard**Branch:** cve-batch-20260913-deps**PR:** #1662 — https://github.com/eclipse-che/che-dashboard/pull/1662**Packages upgraded:** fastify 4.x→5.2.1, undici 6.x→7.3.0, @fastify/cors 10.x→11.0.1**CVEs addressed:** CRW-12921, CRW-12931, CRW-12925**CI:** passing ✓Issues resolved: 3 CVE issues closed in one PR.