Skip to content

Commit 7155d55

Browse files
committed
fix(security): pin SFW download URL to specific version instead of latest
The SFW download URL used releases/latest/download/ which always resolves to the newest release, but SHA-256 checksums are hardcoded for a specific version. When a new SFW release is published, the checksum verification would fail. Add SFW_VERSION constant and pin the URL to it, matching how zizmor already does it.
1 parent bf5169b commit 7155d55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.claude/hooks/setup-security-tools/index.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const ZIZMOR_ASSET_MAP: Record<string, string> = {
5353

5454
// ── SFW constants ──
5555

56+
const SFW_VERSION = '1.6.1'
57+
5658
const SFW_ENTERPRISE_CHECKSUMS: Record<string, string> = {
5759
__proto__: null as unknown as string,
5860
'linux-arm64': '671270231617142404a1564e52672f79b806f9df3f232fcc7606329c0246da55',
@@ -220,7 +222,7 @@ async function setupSfw(apiKey: string | undefined): Promise<boolean> {
220222
const suffix = sfwPlatform.startsWith('windows') ? '.exe' : ''
221223
const asset = `${prefix}-${sfwPlatform}${suffix}`
222224
const repo = isEnterprise ? 'SocketDev/firewall-release' : 'SocketDev/sfw-free'
223-
const url = `https://github.com/${repo}/releases/latest/download/${asset}`
225+
const url = `https://github.com/${repo}/releases/download/v${SFW_VERSION}/${asset}`
224226
const binaryName = isEnterprise ? 'sfw' : 'sfw-free'
225227

226228
// Download (with cache + checksum).

0 commit comments

Comments
 (0)