Skip to content

[guard-coverage] Guard coverage gap: 8 operations from github-mcp-server / GitHub CLI not fully covered #11370

Description

@github-actions

Summary

The GitHub guard does not fully cover 8 operation(s) from the github-mcp-server and/or GitHub CLI. This may allow write operations to bypass DIFC classification or leave read operations without proper secrecy/integrity labeling.

  • MCP tools scanned: 97
  • CLI write commands scanned: 41
  • Guard-covered write tools (tools.rs): 94
  • Tools with explicit DIFC rules (tool_rules.rs): 97+
  • New gaps found this run: 8

MCP Tool Classification Gaps (tools.rs)

These MCP tools perform write or mutating operations but are missing from WRITE_OPERATIONS or READ_WRITE_OPERATIONS in guards/github-guard/rust-guard/src/tools.rs:

Tool Name Operation Type Suggested Classification Notes
create_release write WRITE_OPERATIONS Matches gh release create; creates a release via POST /repos/{owner}/{repo}/releases
edit_release write WRITE_OPERATIONS Matches gh release edit; updates release metadata via PATCH /repos/{owner}/{repo}/releases/{id}
delete_release write WRITE_OPERATIONS Matches gh release delete; deletes a release via DELETE /repos/{owner}/{repo}/releases/{id}
upload_release_asset write WRITE_OPERATIONS Matches gh release upload; uploads release binaries/assets
delete_issue write WRITE_OPERATIONS Matches gh issue delete; removes an issue via GraphQL deleteIssue
update_issue_comment write WRITE_OPERATIONS Matches gh issue comment --edit-last; edits an issue comment via PATCH /repos/{owner}/{repo}/issues/comments/{id}
delete_issue_comment write WRITE_OPERATIONS Matches gh issue comment --delete-last; deletes an issue comment via DELETE /repos/{owner}/{repo}/issues/comments/{id}
delete_repository write WRITE_OPERATIONS Covers destructive repository deletion reachable via gh repo delete

Suggested fix for tools.rs

pub const WRITE_OPERATIONS: &[&str] = &[
    // ... existing entries ...
    "create_release",        // gh release create
    "delete_issue",          // gh issue delete
    "delete_issue_comment",  // gh issue comment --delete-last
    "delete_release",        // gh release delete
    "delete_repository",     // gh repo delete
    "edit_release",          // gh release edit
    "update_issue_comment",  // gh issue comment --edit-last
    "upload_release_asset",  // gh release upload
];

MCP Tool DIFC Labeling Gaps (tool_rules.rs)

These tools are also missing explicit apply_tool_labels match coverage today because they are absent from the repo-scoped write arm in practice:

Tool Name Data Scope Suggested Labels Risk
create_release repo-scoped secrecy: S(repo), integrity: writer Medium
edit_release repo-scoped secrecy: S(repo), integrity: writer Medium
delete_release repo-scoped secrecy: S(repo), integrity: writer Medium
upload_release_asset repo-scoped secrecy: S(repo), integrity: writer Medium
delete_issue repo-scoped secrecy: S(repo), integrity: writer Medium
update_issue_comment repo-scoped secrecy: S(repo), integrity: writer Medium
delete_issue_comment repo-scoped secrecy: S(repo), integrity: writer Medium
delete_repository repo-scoped / destructive secrecy: S(repo), integrity: writer or blocked High

Suggested fix for tool_rules.rs

Ensure these names are included in the repo-scoped write match arm in apply_tool_labels, following the existing pattern for issue, release, and repository writes.


GitHub CLI-Only Gaps

These write operations are reachable via the GitHub CLI and depend on the missing guard entries above:

CLI Command REST Endpoint GitHub API Action Risk
gh release create POST /repos/{owner}/{repo}/releases Creates a repository release Medium
gh release edit PATCH /repos/{owner}/{repo}/releases/{id} Updates release metadata Medium
gh release delete DELETE /repos/{owner}/{repo}/releases/{id} Deletes a release High
gh release upload upload API / release asset endpoint Uploads release assets Medium
gh issue delete GraphQL deleteIssue Deletes an issue High
gh issue comment --edit-last PATCH /repos/{owner}/{repo}/issues/comments/{id} Edits an issue comment Medium
gh issue comment --delete-last DELETE /repos/{owner}/{repo}/issues/comments/{id} Deletes an issue comment Medium
gh repo delete repository deletion endpoint Permanently deletes a repository High

Suggested remediation

  1. Add the eight tool names above to WRITE_OPERATIONS in guards/github-guard/rust-guard/src/tools.rs.
  2. Keep the same eight names in the repo-scoped write arm in guards/github-guard/rust-guard/src/labels/tool_rules.rs (and consider blocking delete_repository if you want parity with other irreversible repo mutations).
  3. Add/update regression tests that compare the repo-scoped write labeling arm against WRITE_OPERATIONS so future CLI-preemptive entries cannot drift.

References

Generated by GitHub Guard Coverage Checker (MCP + CLI) · gpt54 · 57.6 AIC · ⊞ 34.9K ·

  • expires on Aug 31, 2026, 2:37 AM UTC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions