Skip to content

[Bounty proposal] security(github-app): require shared-secret auth on chat-tool routes ($50 proposed) #15010

Closed

Description

@TheRWX

Summary

The server-to-server chat-tool routes under /tools/* in plugins/omi-github-app/main.py accepted uid directly from unauthenticated JSON request bodies and performed authorized GitHub actions using the victim's stored OAuth credentials (SimpleUserStorage.get_user(uid)["access_token"]).

Any unauthenticated caller knowing or guessing a target user's uid could:

  • List all private and public repositories (POST /tools/list_repos)
  • List repository issues (POST /tools/list_issues)
  • Read full details of any repository issue (POST /tools/get_issue)
  • List repository labels (POST /tools/list_labels)
  • Post comments on issues under the victim's GitHub identity (POST /tools/add_issue_comment, POST /tools/add_comment)
  • Create issues in repositories under the victim's GitHub identity (POST /tools/create_issue)
  • Trigger AI agent coding tasks and PR creations using the victim's GitHub identity (POST /tools/code_feature)

Proposed Fix

Following the established plugin shared-secret authorization pattern (#13685, #14455, #14700):

  1. Add plugins/omi-github-app/github_tools_auth.py to enforce GITHUB_TOOLS_SECRET via Authorization: Bearer <secret> or ?github_tools_token=. Fails closed with 503 if unconfigured, 401 on missing or invalid token. Constant-time comparison using hmac.compare_digest.
  2. Apply dependencies=[Depends(require_github_tools_auth)] across all 8 chat-tool routes in plugins/omi-github-app/main.py.
  3. Preserve browser-facing setup and settings endpoints (/, /auth, /auth/callback, /setup-completed, /update-repo, /refresh-repos, /check-repo-access, /save-agent-provider, /save-agent-key, /delete-agent-key, /test-agent, /health) without auth to prevent functional regressions.
  4. Add hermetic test suite plugins/omi-github-app/test_github_tools_auth.py (10 tests) with stubbed FastAPI for standard python3 execution.
  5. Register github-app-tools-auth-tests in .github/checks-manifest.yaml.

Verification

All 10 tests in test_github_tools_auth.py, 73 tests in test_main.py, 10 tests in test_github_client.py, 5 tests in test_create_issue_auto_labels.py (98 total discovery tests), and 53 manifest contract tests pass locally (100% green). All 17 checks in scripts/pr-preflight pass cleanly.

PR is ready to submit.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Sep 19, 2026
  2. TheRWX commented on Sep 19, 2026

    @TheRWX
    ContributorAuthor

    Implemented and verified in PR #15012.

    Hermetic test suite added in plugins/omi-github-app/test_github_tools_auth.py (10 tests passing) and registered in .github/checks-manifest.yaml.

  3. moved this from In progress to In review in omi TODO / bountieson Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions