Require job access in coverage_report before redirecting - #5426
Open
herdiyana256 wants to merge 1 commit into
Open
Require job access in coverage_report before redirecting#5426herdiyana256 wants to merge 1 commit into
herdiyana256 wants to merge 1 commit into
Conversation
GET /coverage-report resolved a job's coverage report URL and redirected to it without an access check. The handler only uses @handler.oauth, which runs even when the Authorization header is absent, so the route is reachable without authentication, and get_report_url validated only the job name and date formats. Coverage reports are per-job data. The other job-scoped handlers already gate on it (fuzzer_stats uses access.has_access(job_type=...)), so any caller, including an unauthenticated one, could resolve the coverage report location and job-to-project mapping for jobs they cannot access. Add access.has_access(job_type=job) after the job name validation, plus a test that a caller without access gets AccessDeniedError.
herdiyana256
force-pushed
the
fix-coverage-report-missing-access
branch
from
August 14, 2026 18:35
3c64c28 to
b26d3ad
Compare
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.
GET /coverage-reportresolves a job's coverage report URL and redirects to it without an access check.The handler only uses
@handler.oauth, which reads theAuthorizationheader when present but still runs the handler when it is absent, so the route is reachable without authentication.get_report_urlonly validates thejobanddateformats:Coverage reports are per-job data, and the other job-scoped handlers already gate on it. For example
fuzzer_stats:Without the same check here, any caller (including an unauthenticated one) can pass an arbitrary job name and get back the coverage report location and the job-to-project mapping for jobs they otherwise cannot access.
Fix adds the job access check right after the name validation:
test_no_accesscovers the denied path; the existing tests mockhas_accessso they keep exercising the URL logic. This is the same missing-access-check fix proposed forissue_redirectorin #5391.