Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
hunsche
reviewed
Nov 17, 2026
hunsche
left a comment
Contributor
There was a problem hiding this comment.
Thanks for catching this. Please fix the mixed indentation in infra/pr_helper.py and infra/pr_helper_test.py (2-space indent) and verify that python3 -m unittest infra/pr_helper_test.py passes locally.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
infra/pr_helper.pydecides whether a PR author is a project'sprimary_contactor on its CC list using the author's email address. When the author's public profile email is empty,get_author_email()falls back to the author email of the PR's first commit. That value is raw git metadata — anyone can set it to an arbitrary address withgit config user.email— and although the code reads GitHub'scommit.verification.verifiedflag for that commit,main()printed the assertionwhether or not the email was verified. The flag only controlled a cosmetic
(verified)suffix.As a result, an attacker can set their first commit's author email to a project's (public)
primary_contact, and the PR helper bot will vouch for them as the primary contact in its comment. Combined with any prior trivial commit by the attacker's login on that project path (which satisfies the separate history check), the PR also keepsIS_READY_FOR_MERGE=True, so the workflow applies the "Ready to merge" label — a manufactured trust signal on exactly theprojects/**changes (Dockerfiles and build scripts executed by OSS-Fuzz build infrastructure) that this check exists to gate.Fix
verifiedis true: the account-linked public profile email, or the first commit's author email with a GitHub-verified commit signature. Verified contacts keep the existing fast path (continue).get_author_email()'s docstring now documents the trust semantics of the returnedverifiedflag so future callers don't reintroduce the confusion.Tests
Added
MainContactVerificationTest(with a fakeGithubHandler) toinfra/pr_helper_test.py:primary_contact→ not asserted, explicit unverified wording, not ready;auto_ccs→ not asserted, not ready;The three unverified-match tests fail against the current code (the bot asserts primary-contact status from the spoofed email) and pass with this change. Full file: 26 tests pass.
infra/presubmit.py formatandlicensepass on the changed files.