Skip to content

CVE Lite: Apply → Commit → Push parity + remediation audit trail (#107) - #108

Merged
alamb-hex merged 11 commits into
mainfrom
feat/cve-lite-commit-push
May 23, 2026
Merged

CVE Lite: Apply → Commit → Push parity + remediation audit trail (#107)#108
alamb-hex merged 11 commits into
mainfrom
feat/cve-lite-commit-push

Conversation

@alamb-hex

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the Patches-style Apply → Commit → Push flow to the CVE Lite security dashboard (/security), scoped to the selected project, reusing the existing /git-commit and /git-push endpoints and generatePatchCommitMessage. No diff review; editable generated commit message; push stays a deliberate click.
  • Emits an origin-tagged remediation audit trail: a security_remediation_applied log on apply (both per-finding Apply and Fix all direct), plus source: 'cve-lite' + advisory IDs folded into the existing commit_created / push_completed log meta. Net: this CVE → this commit → pushed.
  • Guards the commit banner on actual git-dirty state, so a no-op apply (e.g. "Fix all direct" on a transitive-only advisory, which cve-lite --fix can't touch) explains itself instead of dead-ending on "No changes to commit".
  • Also includes the prerequisite CVE Lite offline-fallback fix (CVE Lite scan silently returns zero findings when OSV API is unreachable (online-only) — misses qs/CVE-2026-8723 #105/CVE Lite DB status reads osv-vulns.json but Sync DB writes advisories.db — successful syncs never reflected #106): cve-lite now falls back to the synced advisory DB (--offline-db) when the OSV API is unreachable (previously it failed silently and reported zero findings), and the DB-status indicator reads advisories.db — the file advisories sync actually writes.

Changes

Test plan

  • pnpm typecheck clean
  • pnpm vitest run — 105 tests pass (incl. new remediation-commit + builder tests)
  • pnpm build succeeds
  • Manual: "Fix all direct" no-op on a transitive-only advisory shows the explanatory message and creates no bogus commit (verified via logs + clean tree)
  • Manual: per-finding Apply on a transitive advisory → pnpm.overrides written → Commit → Push, and confirm the security_remediation_applied + commit_created/push_completed log trail carries source: 'cve-lite' + advisory IDs

Closes #105, #106, #107.

🤖 Generated with Claude Code

alamb-hex and others added 11 commits May 22, 2026 21:31
…, #106)

cve-lite was invoked online-only. When the live OSV API is unreachable
(air-gapped/restricted networks), the CLI writes no output file and the
scan silently returned zero findings — masking real CVEs (e.g. qs@6.15.1
GHSA-q8mj-m7cp-5q26 / CVE-2026-8723, which the pnpm-audit Patches view
flagged but CVE Lite did not).

- runCveLiteRaw now tries online first, then falls back to an offline scan
  against the synced advisory DB (--offline-db). Throws on total failure
  instead of returning [] so callers surface a real error (the runner marks
  the source failed; the page route returns 500). Extracted a pure,
  unit-tested buildCveLiteCommand helper.
- readDbStatus() read osv-vulns.json, but `advisories sync` writes
  advisories.db, so a successful Sync DB never reflected in the status
  indicator. Point both (and the offline scan) at one shared
  CVE_LITE_DB_PATH constant = ~/.cache/cve-lite/advisories.db.

Verified: tsc clean; 99 tests pass (+5 builder tests); runCveLiteRaw against
hexops now returns findingCount 1 surfacing qs@6.15.1 → fixed 6.15.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…107)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d remediation-commit (#107)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sent (#107)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…portedOnly) (#107)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… commit (#107)

A transitive-only advisory fixed via 'Fix all direct' (cve-lite --fix) is a
no-op, leaving nothing to commit; the banner used to appear anyway and dead-end
on 'No changes to commit'. Gate it on git-dirty state and explain the transitive
case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alamb-hex
alamb-hex merged commit f185918 into main May 23, 2026
1 check passed
alamb-hex added a commit that referenced this pull request May 24, 2026
… dropped by #108 squash

The pnpm.overrides qs fix from f3a5789 (PR #108) was lost when #108 was
squash-merged, so main regressed to qs@6.15.1 (GHSA-q8mj-m7cp-5q26 /
CVE-2026-8723, qs DoS; transitive via @modelcontextprotocol/sdk -> express).
The cve-lite scan reads pnpm-lock.yaml (resolved-lockfile mode), so it
correctly flagged the regression even though a half-finished dashboard apply
had left node_modules at 6.15.2.

Re-add the override as a minimum-safe-version floor (>=6.15.2) rather than an
exact pin, so it can't become a stale downgrade pin or block a future qs
security patch. Resolves to a single qs@6.15.2; lockfile change is qs-only.

Verified: cve-lite offline scan (OSV advisories.db) findingCount 0; no qs,
CVE-2026-8723, or GHSA-q8mj-m7cp-5q26 in the report. qs@6.15.2 is the sole
copy in both pnpm-lock.yaml and node_modules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CVE Lite scan silently returns zero findings when OSV API is unreachable (online-only) — misses qs/CVE-2026-8723

1 participant