TL;DR
Angular's merge tooling could lose track of a team member's "Request changes" review if 100 newer reviews from non-members landed after it. The tool fetched reviews in a single, non-paginated window of 100 and only filtered out non-members afterwards. Anyone on GitHub can leave a review on a public repository, so outsiders could fill that window.
The impact is limited, and I want to be upfront about that. A team member still has to approve the latest commit before anything merges. What gets lost is another member's objection, not the approval requirement itself.
The interesting part is the pattern. A pagination limit quietly became a security boundary, and the data that filled it was attacker-controlled.
Background: how Angular merges pull requests
Angular's repositories (angular/angular, angular/components and others) are not merged with GitHub's green button. Caretakers use ng-dev pr merge, a CLI that lives in angular/dev-infra. Before merging, it runs a set of validations against the pull request: CLA signed, CI passing, no pending review requests, and so on.
One of them is assertMinimumReviews. It is declared with canBeForceIgnored: false, so a caretaker cannot override it from the command line. It enforces three rules:
- At least one team member (
authorAssociation === 'MEMBER') has approved. - No team member's latest review is "Changes requested".
- A team member has approved the current head commit, unless every commit in the PR was authored by a Googler or a Google-owned robot.
Rule 2 is the one this post is about.
The bug: a 100-item window filled by anyone
The pull request data comes from a single GraphQL query in ng-dev/pr/common/fetch-pull-request.ts. The reviews part looks like this:
reviews: params(
{last: 100, states: '[APPROVED, CHANGES_REQUESTED, DISMISSED]'},
{
nodes: [
{
author: {login: graphqlTypes.string},
authorAssociation: graphqlTypes.custom<CommentAuthorAssociation>(),
state: graphqlTypes.custom<PullRequestReviewState>(),
submittedAt: graphqlTypes.string,
// ...
},
],
},
),There is no pageInfo and no follow-up request. Whatever the newest 100 matching reviews are, that is all the validation will ever see.
The membership filter is applied later, client-side, in assert-minimum-reviews.ts:
for (const review of sortedReviews) {
if (review.authorAssociation !== 'MEMBER') {
continue;
}
// ... keep the latest review per member
}Put the two together and the problem appears. Reviews from non-members are discarded, but only after they have already used up slots in the 100-item window. GitHub lets any account submit an "Approve" or "Request changes" review on a public repository. Those reviews carry no weight in branch protection, but they do count toward last: 100.
So the sequence is:
- A team member reviews the PR and requests changes.
- 100 or more non-member reviews are submitted after that.
- Another team member approves the latest commit.
At merge time, the member's "Changes requested" review is no longer among the newest 100. assertMinimumReviews never sees it, finds a member approval of the head commit, and passes.
Reproduction
I did not try this against a live Angular repository. Flooding a real pull request with reviews would disrupt maintainers and contributors, and it is not needed to show the logic.
Instead I ran the unmodified assert-minimum-reviews.ts in an isolated harness. Its imports are replaced by minimal stubs, and the GraphQL response is modelled by keeping only the newest 100 matching reviews:
function lastN(all, n = 100) {
return all
.filter((r) => ['APPROVED', 'CHANGES_REQUESTED', 'DISMISSED'].includes(r.state))
.slice(-n);
}
// Scenario B: a member requests changes, 100 non-member reviews follow,
// then another member approves the head commit.
const all = [review('member-y', 'MEMBER', 'CHANGES_REQUESTED')];
for (let i = 0; i < 100; i++) all.push(review('non-member', 'NONE', 'APPROVED'));
all.push(review('member-x', 'MEMBER', 'APPROVED'));Running it with Node.js 22 (node --experimental-strip-types run.mjs):
A (baseline): BLOCKED -> Pull request cannot be merged while a team member has requested changes.
B (100 non-member reviews in between): PASSES validation (merge allowed)Scenario A is the same PR without the extra reviews, and the validation blocks it as intended. Scenario B is identical except for the 100 non-member reviews, and it passes.
Impact and limits
This is a low-severity issue, and the limits matter as much as the bug:
- The approval requirement still holds. A team member must still approve the head commit. Nobody can merge unreviewed code this way.
- Only an objection is lost. The bug hides an existing "Changes requested" review from the merge gate. A second member approving afterwards is required.
- It is noisy. 100 drive-by reviews on one PR are hard to miss.
- Humans still see it. GitHub's own UI keeps showing the "Changes requested" state to whoever runs the merge.
- Branch protection may catch it. If the repository's GitHub branch protection independently blocks on outstanding change requests, the practical impact drops further. I could not observe those settings from outside.
What makes it worth reporting is that the check is designed as a hard gate (canBeForceIgnored: false), and outsiders control the input that defeats it.
The fix
GitHub's GraphQL API already has a field for exactly this question: latestOpinionatedReviews. It returns the latest approving or change-requesting review per author, and writersOnly: true restricts it to people with write access.
latestOpinionatedReviews(first: 100, writersOnly: true) {
nodes {
author { login }
state
commit { oid }
}
}With that, non-members cannot occupy the window at all, and each writer takes one slot no matter how many reviews they leave. The alternative is to paginate the reviews connection fully using pageInfo.
The same root cause appears once more in the same file. The exemption in rule 3 checks commit authors using commits(last: 100), and a code comment states the assumption directly: "we likely will never see a pull requests with more than 100 commits". Commits beyond that window are not verified. This is lower risk, because adding commits to a PR branch requires push access to it.
Lessons
Pagination limits are security boundaries when the data is attacker-controlled. last: 100 reads like a performance detail. Here it decided which reviews the merge gate could see, and anyone on GitHub could add reviews.
Filter before you limit, not after. The membership check was correct. It just ran on a list that had already been truncated using data that included non-members. Filtering server-side (writersOnly: true) or paginating fully closes that gap.
Look for the comment that says "likely will never". The commits query is documented with exactly that assumption. Assumptions about how much data there will be are worth testing whenever someone else controls how much data there is.
What else I reviewed
The rest of the dev-infra code I looked at held up well, and it is worth saying so:
- Preview deployments. The pipeline that deploys PR previews to Firebase builds in an unprivileged workflow and deploys from a privileged
workflow_run. The deploy side checks the artifact's metadata against strict formats, binds the claimed PR number to the triggering run's head SHA, and rejects symlinks. pull_request_targetactions. The labeling, branch-manager and post-approval-changes actions all check out the base branch, never the PR's code, and never put PR data into shell commands.- Post-approval changes. A dedicated action re-requests reviews when a non-Googler pushes after approval, and the merge tool independently requires approval of the head commit.
- Google internal tests status. It fails closed when the PR's file list hits GitHub's pagination limit, which is exactly the habit the review query was missing.
- AI issue labeling. The label suggested by Gemini is checked against the repository's list of valid labels before it is applied.
Disclosure timeline
| Date | Event |
|---|---|
| 2026-11-29 | Issue found, reproduced in an isolated harness, and reported to the Google Open Source VRP (issue 591400911) |
| TBD | Fix released |
| TBD | This post published |
Get the next post by email
One email when something new is published.