Repository navigation
Conversation
…case_id> The issue redirector loads the testcase with helpers.get_testcase, which does not authorize the caller, and then redirects to the associated issue URL. For a testcase with security_flag set, an unauthenticated caller who knows the testcase id therefore learns that the testcase exists and which issue it is associated with, even though the protected testcase-facing endpoints withhold exactly that from the same caller. Apply the policy already used by crash queries and testcase downloads: do not disclose the existence or identifiers of a security-confidential testcase to a user who is not allowed to access it. Testcases that are not security-confidential keep redirecting without a session, which is what this handler exists for (crbug.com/665652).
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.
issue_redirector.Handlerloads the testcase withhelpers.get_testcase, which does not authorize the caller, and then redirects to the associated issue URL. For a testcase withsecurity_flagset, an unauthenticated caller who knows the testcase id learns that the testcase exists and which issue it is associated with — exactly what the protected testcase-facing endpoints withhold from that same caller.This applies the policy already used by crash queries and by testcase downloads. PR #5297 states it directly for
crash_query.py: "Do not disclose the existence or identifiers of a security-confidential testcase to a user who is not allowed to access it."The check is deliberately scoped to
security_flag.access.can_user_access_testcasereturns false for any anonymous caller, so gating every testcase on it would break the anonymous redirects this handler exists to provide (crbug.com/665652). Testcases that are not security-confidential keep redirecting exactly as before.Reported through Google Bug Hunters (issue 561678864). It was assessed as defense-in-depth rather than a tracked security bug, and the Bug Hunters team asked me to submit the fix here as a pull request.
Tests
Two cases added to the existing
issue_redirector_test.py: a security testcase without access, asserting the response never carries the issue id in theLocationheader or the body, and a security testcase with access, asserting the redirect still works. The first fails without the handler change and passes with it.Running that file locally gives 3 passed and 1 failed, where the failure is
test_no_issue_url, which already fails the same way on an unmodified checkout in my environment. I could not stand up the fullbutler.py py_unittesttoolchain (asdf + Python 3.11 + pipenv) on this machine, so I ran the file directly under pytest withCONFIG_DIR_OVERRIDE=./configs/test; CI will be the real check.