Repository navigation
Fix author-aware integrity labeling - #14935
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 954e6260-61f4-4b25-9bf5-99fdd0b623d0
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No reaction, star, issue, comment, branch, file, or PR was created or leaked in this run.
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved trust bypasses and response-shape regressions can expose blocked content or discard resource data.
8 open findings
Nested replies bypass author integrity checks · New Singleton responses are misclassified as collections · New Review thread envelopes bypass per-comment filtering · New Spoofed commit authors elevate fork content integrity · New Check runs and statuses receive unjustified writer integrity · New Blocked integrity is lost during label normalization · New Private discussion comments omit the approved integrity floor · New Combined status fields are dropped by response extraction · New
What changed in this PR
Hardens the Rust GitHub guard’s integrity labeling against author-provenance bypasses.
Changes:
- Adds blocked-user precedence and per-author content labeling.
- Introduces conservative sub-resource defaults, broader response extraction, and regression tests.
- Updates integrity documentation and release notes.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Updates coarse integrity rules and blocking checks. |
guards/github-guard/rust-guard/src/labels/response_paths.rs |
Adds author-aware collection and sub-resource labels. |
guards/github-guard/rust-guard/src/labels/response_items.rs |
Extends author-aware legacy item labeling. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Updates discussion integrity expectations. |
guards/github-guard/rust-guard/src/labels/helpers.rs |
Adds author helpers and response-envelope extraction. |
guards/github-guard/docs/INTEGRITY_TAG_SPEC.md |
Documents revised sub-resource integrity rules. |
docs/RELEASE_NOTES.md |
Announces author-aware integrity changes. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| integrity, | ||
| ctx, | ||
| ); | ||
| ensure_integrity_baseline(repo_full_name, &integrity, ctx) |
| ("review_comments", "/review_comments"), | ||
| ("commits", "/commits"), | ||
| ("files", "/files"), | ||
| ("labels", "/labels"), |
| "get_comments" | "get_reviews" | "get_review_comments" | ||
| ) | ||
| { | ||
| return label_author_items(tool_name, tool_args, &actual_response, method, ctx); |
| integrity: commit_integrity_with_visibility( | ||
| item, | ||
| &repo_full, | ||
| repo_private, | ||
| false, |
| labels: repo_default_labels( | ||
| "pull-request-status", | ||
| secrecy.clone(), | ||
| writer_integrity(&repo_full, ctx), | ||
| ), |
| if author_login.is_some_and(|login| is_blocked_user(login, ctx)) { | ||
| return blocked_integrity(repo_id, ctx); |
| return blocked_integrity(repo_full_name, ctx); | ||
| } | ||
|
|
||
| let mut integrity = author_association_floor(item, repo_full_name, ctx); |
| let (owner, repo, repo_full) = extract_repo_info(tool_args); | ||
| let secrecy: crate::SharedLabels = | ||
| repo_visibility_secrecy(&owner, &repo, &repo_full, ctx).into(); | ||
| let (items, items_path) = extract_items_array(&actual_response); |


Summary
Remediates the author-provenance integrity bypasses reported in GHSA-5x56-229p-xf9f and the unresolved author-labeling portions of GHSA-g63x-69j3-vxf5.
blocked-userstake precedence inresolve_author_integritybefore trusted-user or collaborator elevationgetissue_readandpull_request_readcoarse labels fail closed instead of inheriting the parent issue/PR author's trustnoneintegrity while retaining writer integrity for maintainer-controlled labels, check runs, and status metadataAdvisory mapping
GHSA-5x56-229p-xf9f
list_discussionstrusted every discussion as repository-writer contentnone; each discussion uses its own authordiscussions.nodesget_discussiontrusted the body as repository-writer contentrepository.discussionget_discussion_commentstrusted all comments as repository-writer contentdiscussion.comments.nodeslist_discussion_categoriesremains writer integrityGHSA-g63x-69j3-vxf5
resolve_author_integrityskippedblocked-usersget_commentsinherited parent PR integrityget_reviewsinherited parent PR integrityget_review_commentsinherited parent PR integrityget_commitsinherited parent PR integrityget_files/get_difflacked per-item author evidencenoneget_check_runs/get_statusare maintainer-controlled metadataget_sub_issuesinherited parent issue integritysubIssues.nodesget_labelsis maintainer-controlled metadatagetresource labels now fail closedThe previously fixed
issue_read(method=get_comments)behavior remains intact: comments continue through the existing issue-item author-aware path, and aNONEoutsider remainsunapprovedrather than inheriting the parent issue's integrity.Validation
cargo test --manifest-path guards/github-guard/rust-guard/Cargo.toml --lib --quiet(682 passed)make agent-finished(✓ All agent-finished checks passed!)