Add job-level authorization check to revisions info handler#5317
Open
adilburaksen wants to merge 1 commit into
Open
Add job-level authorization check to revisions info handler#5317adilburaksen wants to merge 1 commit into
adilburaksen wants to merge 1 commit into
Conversation
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.
Summary
revisions_info.py(GET /revisions) is decorated with@handler.oauth(which provides identity only, not authorization) and reads thejobrequest parameter without any access check before callingrevisions.get_component_range_list(..., job_type). A user who is not authorized for the job/project can therefore read its source-repository layout — component names, repository URLs, and revisions/commit hashes derived from the job'sREVISION_VARS_URL/DEPS.This is the same class as the missing access checks on
issue_redirectorandcoverage_reporttracked in #5258 / #5304 (job/testcase-keyed read handlers without an access check);revisions_infois a third handler of that class that those changes do not cover.Change
Mirror the gate used for the sibling handlers (
coverage_report,fuzzer_stats): if ajobis supplied, require access to it.An empty
jobfalls through to the existing general-access path (the project-defaultREVISION_VARS_URL), so authorized usage is unaffected.