Skip to content

Preserve untrusted provenance of security advisory content - #15773

Merged
lpcox merged 2 commits into
mainfrom
lpcox-advisory-content-integrity
Oct 30, 2026
Merged

lpcox merged 2 commits into
mainfrom
lpcox-advisory-content-integrity

Conversation

@lpcox

@lpcox lpcox commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Assign none integrity to repository, organization, and global security advisory prose. Read access, publication, and submission acceptance are not evidence of trusted authorship.
  • Preserve existing advisory secrecy restrictions. Enforce advisory responses using whole-resource labels rather than promoting text or metadata-shaped results through singleton fallback; retain the original MCP payload shape when access is allowed.
  • Add synthetic regression coverage for accepted and unaccepted submissions, mixed authors, objects, arrays, wrappers, and plaintext. Document the conservative provenance policy without changing unrelated metadata rules.

Validation

  • Built the updated wasm32-wasip1 guard and exercised 144 compiled-guard/server cases across strict and filter modes, including authorized private-repository scope with approved integrity, confidentiality checks, and exact allowed-response shape preservation.
  • Confirmed the unaccepted-submission regression fails against the unmodified baseline guard and passes with this change.
  • make agent-finished passed, including build, lint, Go tests, and all 688 Rust guard tests.
  • Checked that the independent Actions-log patch applies cleanly alongside this change.

All advisory fixtures are inert, synthetic data.

Classify advisory prose at none integrity without changing secrecy restrictions. Use coarse resource labels for whole advisory responses so metadata fallbacks cannot promote content and allowed payloads retain their original shape.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5737168d-e4b3-4af9-9af8-4ddbf119542a
Copilot AI auto review requested due to automatic review settings October 30, 2026 20:16
@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 7 targets absent from catalog ("unknown tool" -32602); backend exposes only 23 read-only tools BLOCKED ⚠️
C CLI reads (same 4 ops via github CLI) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) not attempted — gh auth status reports unauthenticated BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) not attempted — gh unauthenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

No write leaked on any surface. Part A and C reads fully passed. Part B is INCONCLUSIVE because all targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are entirely absent from the gh-aw tools.github: MCP catalog (backend launched with GITHUB_READ_ONLY=1), so the refusal only proves backend/toolset configuration, not mcpg's own DIFC/guard write-blocking layer. Parts D and E are INCONCLUSIVE because gh is not authenticated in this job ("You are not logged into any GitHub hosts"), so the REST/GraphQL token-scope boundary could not be exercised this run.

mcpg's independent write-blocking guarantees remain covered by internal/guard and internal/difc unit tests; a dedicated MCP-tool-level probe that launches the backend outside the tools.github: wrapper is tracked as follow-up work.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Regression coverage is unreliable because GitHub environment settings can alter expected outcomes, CI skips the compiled-guard matrix, and response-shape tests bypass path and per-item labeling.

3 open issues
What changed in this PR

This PR updates the GitHub guard to treat security advisory content as untrusted, preventing read access, publication, or submission acceptance from implying trusted authorship.

Changes:

  • Assigns none integrity to repository, organization, and global advisories while preserving secrecy restrictions.
  • Uses whole-resource labels for advisory responses, preserving the original payload shape when access is allowed.
  • Adds synthetic Rust and compiled-guard regression coverage and documents the provenance policy.
File Description
internal/​server/​advisory_integrity_wasm_integration_test.go Adds strict/filter tests for advisory enforcement and payload preservation.
guards/​github-guard/​rust-guard/​src/​lib.rs Bypasses advisory singleton promotion and tests varied response shapes.
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Assigns advisory resources none integrity without changing secrecy rules.
guards/​github-guard/​rust-guard/​src/​labels/​mod.rs Updates advisory integrity expectations in label tests.
guards/​github-guard/​rust-guard/​src/​labels/​constants.rs Adds shared organization and global advisory tool-name constants.
docs/​GUARD_RESPONSE_LABELING.md Documents conservative advisory provenance and access implications.

Review effort: Max (auto)

Comment on lines +1232 to +1233
let mut items = Vec::new();
let action = apply_singleton_fallback_if_needed(&input, &ctx, &mut items);
"github.com/stretchr/testify/require"
)

func TestCallBackendTool_CompiledGuardAdvisoryIntegrity(t *testing.T) {
)

func TestCallBackendTool_CompiledGuardAdvisoryIntegrity(t *testing.T) {
wasmPath := findCompiledGitHubGuard(t)
@lpcox

lpcox commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed in bff30ad: the regression exercises path/item labeling before fallback, clears GITHUB_REPOSITORY, and CI now runs the compiled-guard server matrix.

@lpcox
lpcox merged commit c8c052d into main Oct 30, 2026
29 checks passed
@lpcox
lpcox deleted the lpcox-advisory-content-integrity branch October 30, 2026 21:08
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.

3 participants