Skip to content

Require testcase access in issue_redirector before redirecting#5391

Open
herdiyana256 wants to merge 1 commit into
google:masterfrom
herdiyana256:fix-issue-redirector-missing-access-check
Open

Require testcase access in issue_redirector before redirecting#5391
herdiyana256 wants to merge 1 commit into
google:masterfrom
herdiyana256:fix-issue-redirector-missing-access-check

Conversation

@herdiyana256

Copy link
Copy Markdown

GET /issue/<testcase_id> looked up the testcase and redirected straight to its issue tracker URL with no access check at all -- this route has no auth decorator, and helpers.get_testcase() is a plain datastore fetch with no ownership or security_flag check of its own.

testcase_id is a small sequential integer, so this let anyone, completely unauthenticated, enumerate testcases and learn the associated issue tracker URL for each one, including security-flagged/embargoed testcases that access.can_user_access_testcase() is meant to gate everywhere else in the app (crash_query, testcase_detail, download, etc. all check it).

Added the same check here: raise AccessDeniedError before building the redirect if the caller can't access the testcase.

Added a test confirming a caller without access gets a 403 instead of being redirected; the existing tests needed can_user_access_testcase mocked to True to keep passing, since they previously didn't exercise any access check at all.

GET /issue/<testcase_id> looked up the testcase and redirected
straight to its issue tracker URL with no access check at all, not
even the general access.has_access() used elsewhere -- this route has
no auth decorator and helpers.get_testcase() is a plain datastore
fetch with no ownership or security_flag check.

testcase_id is a small sequential integer, so this let anyone,
unauthenticated, enumerate testcases and learn the associated issue
tracker URL for each one, including security-flagged/embargoed
testcases that access.can_user_access_testcase() is meant to gate
everywhere else in the app.

Added a test confirming a caller without access gets a 403 instead of
being redirected.
@herdiyana256
herdiyana256 requested a review from a team as a code owner July 25, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant