| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
pull_request_read's get_commits method previously returned commit messages without any lockdown check, unlike get_diff and get_files which restrict the whole result when the PR author lacks push access. Commit content is part of the same untrusted head branch as the diff and file list, so GetPullRequestCommits now reuses enforcePullRequestLockdown for consistent, fail-closed behavior without adding a per-commit permission lookup. Also updates the lockdown documentation in README.md and docs/server-configuration.md to: - list pull_request_read:get_diff, get_files, and get_commits among the tools that error when the PR author lacks push access (get_diff and get_files were already implemented this way but undocumented) - clarify that lockdown mode is a best-effort content filter to reduce prompt-injection risk, not an authorization boundary - document the existing intentional trusted-bot exception (github-actions[bot], copilot) accurately Fixes #3105 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Hardens pull_request_read:get_commits by applying existing lockdown protections to commit content.
Changes:
| File | Description |
|---|---|
| README.md | Documents lockdown behavior and affected PR methods. |
| pkg/github/pullrequests.go | Applies lockdown checks to commit retrieval. |
| pkg/github/pullrequests_test.go | Tests commit retrieval under lockdown scenarios. |
| docs/server-configuration.md | Clarifies lockdown’s security model and bot exceptions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
pull_request_read's get_commits method returned commit messages without any lockdown check, unlike get_diff and get_files, which already restrict the whole result when the PR author lacks push access. This meant commit content from an untrusted fork PR bypassed the lockdown model applied to comparable pull request content.
Changes
Design tradeoff
Commits are structurally a list with per-item authorship info (RepositoryCommit.Author), similar to reviews/comments, which are filtered per-item. However, I chose the PR-author whole-result check (same as get_diff/get_files) instead of per-commit filtering because:
Testing
Fixes #3105
Acknowledgments
Thanks @0xk1h0, @nickelsec, and @mahdi-al-hakim for the reports that led to this hardening.