fix: reject unsupported URLs before Gmail fallthrough in Google Gatekeeper - #72
Closed
Ashutosh0x wants to merge 1 commit into
Closed
Conversation
…eeper getGatekeeperClassFor() falls through to the Gmail branch for any URL that does not match Docs, Sheets, Calendar, or BigQuery — including non-Google URLs like https://evil.example/resource. This silently returns a Gmail capability for an unrelated resource URL. Add a hostname check for mail.google.com before the fallthrough so unsupported URLs are rejected with a clear error. Fixes cloudflare#63
Author
|
I have read the CLA Document and I hereby sign the CLA |
Member
|
Hi @Ashutosh0x, Apologies but, per our contributing guide, we prefer not to receive external pull requests. We prefer instead to receive issue reports, which we can then direct our own agents to solve. Could you please file an issue instead? |
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.
Fixes #63
Problem
\getGatekeeperClassFor()\ falls through to the Gmail branch for any URL that doesn't match Docs, Sheets, Calendar, or BigQuery — including non-Google URLs like \https://evil.example/resource\. This silently returns a Gmail capability for an unrelated resource URL, weakening the resource-URL boundary and making audit records misleading.
Fix
Add a hostname check for \mail.google.com\ before the Gmail fallthrough. Unsupported URLs now get a clear error listing the supported resources.
9 insertions, 0 deletions.
cc @jonesphillip @kentonv