Skip to content

Add automatic update checks for security tools (zizmor, SFW)#1186

Open
John-David Dalton (jdalton) wants to merge 1 commit intomainfrom
feat/security-tools-updater
Open

Add automatic update checks for security tools (zizmor, SFW)#1186
John-David Dalton (jdalton) wants to merge 1 commit intomainfrom
feat/security-tools-updater

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton John-David Dalton (jdalton) commented Apr 10, 2026

What this adds

A version checker that runs as part of the /update workflow:

  • Zizmor: checks GitHub releases, respects pnpm minimumReleaseAge cooldown (reads from pnpm-workspace.yaml)
  • SFW (Socket Firewall): checks both free and enterprise releases, no cooldown (Socket-owned)
  • Claude Code: syncs @anthropic-ai/claude-code catalog version from installed binary

When new versions are found, the script updates the embedded checksums in setup-security-tools/index.mts in-place.

Files

  • .claude/hooks/setup-security-tools/update.mts — the version checker
  • .claude/skills/updating/SKILL.md — adds phases 3b (security tools) and 3c (Claude Code sync)

Depends on

PR #1185 (setup-security-tools) must be merged first — update.mts modifies files created by that PR.


Note

Medium Risk
Medium risk because it introduces a new automated updater that calls the GitHub API/CLI, downloads release assets, and rewrites embedded checksums in-place; failures or parsing mismatches could break the setup-security-tools hook or make updates flaky in CI.

Overview
Adds a new .claude/hooks/setup-security-tools/update.mts script that checks GitHub releases for zizmor and Socket Firewall (sfw-free and enterprise), computes SHA-256 checksums for platform binaries, and updates the embedded version/checksum constants in setup-security-tools/index.mts.

The updater respects pnpm’s minimumReleaseAge cooldown (read from pnpm-workspace.yaml) for third-party tools (zizmor) while bypassing cooldown for Socket-owned tools, and it emits a simple per-tool update/skip summary.

Updates the updating skill docs to run this security-tools updater (and to sync Claude Code versions), and adjusts .gitignore to keep .claude/hooks/ and .claude/settings.json tracked instead of blanket-ignoring all .claude content.

Reviewed by Cursor Bugbot for commit 2f74030. Configure here.

Checks for new zizmor and SFW releases, respects pnpm
minimumReleaseAge cooldown for third-party tools, updates
embedded checksums. Also adds Claude Code version sync phase.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2f74030. Configure here.

logger.log(` ${assetName}: ${oldHash.slice(0, 12)}... -> ${newHash.slice(0, 12)}...`)
} else if (oldHash === newHash) {
logger.log(` ${assetName}: unchanged`)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing guard allows version bump with incomplete checksums

Medium Severity

In the zizmor update loop, when newHash is defined (e.g. from checksumMap) but oldHash is undefined (the entry doesn't exist in the source file), neither the if nor the else if branch executes, and allFound is never set to false. This allows the code to reach the version bump at line 298 even though a checksum entry was not actually updated in the source. The version constant gets incremented while the source is missing or has a stale checksum for that asset, leaving index.mts in an inconsistent state.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f74030. Configure here.

newChecksums[platform] = currentChecksums[platform] ?? ''
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated download-and-hash logic in SFW checker

Low Severity

The if (!asset) and else branches in fetchSfwChecksums contain ~15 lines of nearly identical code (log, try/catch around downloadAndHash, set newChecksums, compare for changes, handle errors). The only difference is the URL passed to downloadAndHash. Computing the URL once before the shared try/catch block would eliminate this duplication and reduce the risk of the two branches diverging during future maintenance.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f74030. Configure here.

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.

1 participant