Skip to content

security: harden notifications, ref handling, signals, and release pipeline#3

Merged
watany-dev merged 2 commits intomainfrom
claude/security-vulnerability-plan-9reZ4
May 1, 2026
Merged

security: harden notifications, ref handling, signals, and release pipeline#3
watany-dev merged 2 commits intomainfrom
claude/security-vulnerability-plan-9reZ4

Conversation

@watany-dev
Copy link
Copy Markdown
Owner

Pre-release security pass before public beta. Changes are grouped into four
self-contained hardening areas, each with new tests:

  • internal/notify: replace ad-hoc PowerShell quoting with -EncodedCommand
    (UTF-16LE base64), add -- separator for notify-send, sanitize control
    characters and cap field length so a malicious branch name or backupRef
    can't smuggle escapes into a toast or terminal.
  • internal/git: tighten branch-name handling for backup refs to an allowlist
    ([A-Za-z0-9._-]) with hash fallback, and replace the prefix-only IsBackupRef
    with a full-pattern match so that user-supplied refs containing git
    revision syntax (@{N}, ^, ~, :) cannot reach git reset --hard via
    rescue restore.
  • internal/cli + cmd/git-real: thread context.Context through Run, runStart,
    runChallenge, and sleepUntil; main wires signal.NotifyContext for SIGINT
    and SIGTERM so Ctrl-C during the grace period exits cleanly without
    applying a penalty.
  • Makefile + release workflow: build with -trimpath, -buildvcs, embedded
    version/commit/date, and a pinned SOURCE_DATE_EPOCH for reproducible
    binaries; sign SHA256SUMS via cosign keyless OIDC and ship the .sig/.pem
    alongside the archives. Adds git real --version and verification
    instructions in the README.

https://claude.ai/code/session_01BQTaxBPYMX7YFsicvwNdUG

claude added 2 commits May 1, 2026 05:34
…peline

Pre-release security pass before public beta. Changes are grouped into four
self-contained hardening areas, each with new tests:

- internal/notify: replace ad-hoc PowerShell quoting with -EncodedCommand
  (UTF-16LE base64), add `--` separator for notify-send, sanitize control
  characters and cap field length so a malicious branch name or backupRef
  can't smuggle escapes into a toast or terminal.
- internal/git: tighten branch-name handling for backup refs to an allowlist
  ([A-Za-z0-9._-]) with hash fallback, and replace the prefix-only IsBackupRef
  with a full-pattern match so that user-supplied refs containing git
  revision syntax (@{N}, ^, ~, :) cannot reach `git reset --hard` via
  `rescue restore`.
- internal/cli + cmd/git-real: thread context.Context through Run, runStart,
  runChallenge, and sleepUntil; main wires signal.NotifyContext for SIGINT
  and SIGTERM so Ctrl-C during the grace period exits cleanly without
  applying a penalty.
- Makefile + release workflow: build with -trimpath, -buildvcs, embedded
  version/commit/date, and a pinned SOURCE_DATE_EPOCH for reproducible
  binaries; sign SHA256SUMS via cosign keyless OIDC and ship the .sig/.pem
  alongside the archives. Adds `git real --version` and verification
  instructions in the README.

https://claude.ai/code/session_01BQTaxBPYMX7YFsicvwNdUG
zizmor (v1.24.1) flagged 22 supply-chain and least-privilege findings on
the existing workflows. Address all of them:

- Pin every action to a full commit SHA with the corresponding semver tag
  in a comment, so a tag-rewrite attack on a popular action repository
  (e.g. tj-actions/changed-files) cannot reach our builds.
- Switch the workflow-level `permissions` to deny-by-default and grant the
  minimum scope per job: read for build, write only for the publish job
  that mints the release and signs blobs via OIDC.
- Add `permissions: contents: read` to the ci check job.
- Pass `persist-credentials: false` to actions/checkout so the GITHUB_TOKEN
  is not persisted into `.git/config` for later steps.
- Disable the setup-go cache in the release workflow to avoid cache
  poisoning influencing released binaries.
- Replace softprops/action-gh-release with the runner-resident `gh release
  create`, removing one third-party dependency from the publish path.

actionlint reports no findings; zizmor now reports zero findings (the 5
remaining are low-confidence suppressions).

https://claude.ai/code/session_01BQTaxBPYMX7YFsicvwNdUG
@watany-dev watany-dev merged commit f6c3448 into main May 1, 2026
1 check passed
@watany-dev watany-dev deleted the claude/security-vulnerability-plan-9reZ4 branch May 1, 2026 05:50
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.

2 participants