Skip to content

Add access checks to issue_redirector and coverage_report handlers#5259

Open
sammiee5311 wants to merge 1 commit intogoogle:masterfrom
sammiee5311:fix-missing-access-checks
Open

Add access checks to issue_redirector and coverage_report handlers#5259
sammiee5311 wants to merge 1 commit intogoogle:masterfrom
sammiee5311:fix-missing-access-checks

Conversation

@sammiee5311
Copy link
Copy Markdown

Fixes #5258.

/issue/<testcase_id> was using helpers.get_testcase() which fetches by ID with no access check. Switched it to access.check_access_and_get_testcase(), the same call the rest of the testcase handlers use (testcase_detail/show.py, download_testcase.py).

/coverage-report/... had @handler.oauth but that decorator only populates an email if one's present, it doesn't authorize. Added a has_access(job_type=job) check before resolving the URL. Same pattern as fuzzer_stats.py. Pulled the input validation out into _validate_args so the handler and get_report_url aren't duplicating it.

This is the same class of issue as #5196 (task-log, fixed in #5243).

Test plan

  • python butler.py py_unittest -t appengine -p issue_redirector_test.py — 3/3 pass
  • python butler.py py_unittest -t appengine -p coverage_report_test.py — 7/7 pass (3 existing + 4 new in HandlerAccessTest)
  • New tests cover the access-denied path and assert the URL resolver is never called when access is denied

issue_redirector previously fetched testcases by ID without any access
check, exposing bug-tracker URLs (including for security-sensitive
testcases) to anyone able to iterate testcase IDs. Switch to
access.check_access_and_get_testcase, matching the rest of the
testcase handlers.

coverage_report's @handler.oauth decorator only populates an email; it
does not authorize. Add access.has_access(job_type=...) before
resolving the report URL so non-authorized users cannot pull coverage
maps for projects they do not own.
@sammiee5311 sammiee5311 requested a review from a team as a code owner April 28, 2026 15:43
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.

Two handlers missing access checks: issue_redirector and coverage_report

1 participant