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

@herdiyana256 herdiyana256 commented Jul 25, 2026

Copy link
Copy Markdown

issue_redirector takes a testcase id and 302-redirects the caller to that testcase's bug URL, with no access check at all:

class Handler(base_handler.Handler):
  def get(self, testcase_id):
    testcase = ...
    self.redirect(get_issue_url(testcase))

There was no authorization on the testcase, so any caller could hit /issue/<testcase_id> and be redirected to the linked bug for any testcase, including security-restricted ones, disclosing the bug id and the existence of the testcase.

from libs import access
...
if not access.can_user_access_testcase(testcase):
  raise helpers.AccessDeniedError()

The redirect is now gated on the same testcase-access check the rest of the app uses. Adds a regression test asserting a caller without access is denied instead of redirected.

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

Copy link
Copy Markdown
Author

Gentle bump, open ~3 weeks with no reviewer. Small access-control fix: /issue/<testcase_id> redirects to a testcase's bug tracker URL with no access check, reachable unauthenticated. @PauloVLB @javanlacerda could one of you take a look or route it?

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