Skip to content

fix(cli): validate issue repository before signing - #7076

Open
johnely19 wants to merge 1 commit into
block:mainfrom
johnely19:fix/cli-owner-validation-2dd046aa
Open

fix(cli): validate issue repository before signing#7076
johnely19 wants to merge 1 commit into
block:mainfrom
johnely19:fix/cli-owner-validation-2dd046aa

Conversation

@johnely19

Copy link
Copy Markdown

Summary

buzz issues create previously accepted any hex-shaped --repo-owner and signed that owner/id pair directly into the issue event. A typo or stale owner could therefore publish an issue under a repository address that no repository announcement resolves.

This change resolves the exact kind-30617 repository announcement for the supplied owner and repo id before constructing or signing the issue event. It fails closed when the relay query fails or the response does not contain the requested kind/author/d tuple, and names the rejected owner/id pair in the error. The valid path still constructs and signs exactly once.

Related issue

N/A — no matching open issue or PR found.

Testing

  • cargo fmt --all -- --check
  • cargo test -p buzz-cli — 415 passed, 0 failed
  • Frozen black-box harness against the release binary:
    • corrupt, unknown, wrong-d, wrong-owner, and wrong-kind announcements all refused before publish
    • exact valid announcement performed one query and one publish
  • Release build: cargo build --release -p buzz-cli
  • Installed-binary live control: a fresh invalid owner/id pair was refused before signing, and a follow-up query found zero matching issue events

`buzz issues create` accepted any hex-shaped --repo-owner and signed it
straight into the event's a and p tags. Two real incidents (2026-08-24,
2026-08-27) permanently archived issues under corrupted owner keys — one a
genuine product task invisible to every listing tool for six days.

The create path now resolves an exact kind-30617 repository announcement
for the supplied owner/id pair (kinds/authors/#d/limit:1, the same filter
shape as fetch_own_repo_announcement) and refuses before any event
construction or signing when none exists or the returned event does not
match the pair. Resolution runs through a gated seam
(cmd_create_issue_gated) so build/sign ordering is unit-asserted: zero
constructions on any invalid arm, exactly one on success.

Signed-off-by: John Ely <john@heyricordo.com>
@johnely19
johnely19 requested a review from a team as a code owner August 31, 2026 01:29
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is eed74bde2f4797714335ac10c56c0b0244c1def4...ad78909457b93def2ac9e1ed7f710de24017d0bd.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review ad78909457b93def2ac9e1ed7f710de24017d0bd to authorize a new review.
Any previous review applies only to its recorded range.

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