Require job access in coverage_report before redirecting - #5426
Require job access in coverage_report before redirecting#5426herdiyana256 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.
3c64c28 to
b26d3ad
Compare
|
Friendly bump on this one, and a question about CI. What the change does
The patch adds Why this shape is the right oneThe parity argument is inside this repo. On public OSS-Fuzz the coverage reports are public anyway, so the impact case is private deployments where jobs and projects are access controlled. There, an unauthenticated caller could enumerate job names and learn the coverage report location and project mapping for jobs they cannot otherwise see. CI questionTwo Cloud Build checks report failure here, For what it is worth, the pattern across currently open PRs is mixed rather than uniformly fork related: #5424 and #5425 are also from forks and their The change touches two files, One note for whoever picks this up#5389, #5390 and #5391 are the same class of missing access check on other handlers, and all four have been sitting without a review since 14 August. If it is easier to look at them as a batch, or if you would rather I consolidate or close and resubmit them differently, just say which you prefer and I will do that. |
coverage_reportresolves and redirects to the coverage report URL for a job taken from the request, decorated only with@handler.oauth:Coverage reports are per-job data, but
@handler.oauthauthenticates the caller without authorizing access to any particular job (the same gap the other job-scoped handlers likefuzzer_statsalready close). So any caller could resolve the coverage report location for an arbitrary job, and by extension its project.The resolution is now gated on job access, matching the sibling job-scoped handlers. Adds a regression test for the access-denied path.