Require job access in revisions_info before disclosing component revisions - #5431
Open
herdiyana256 wants to merge 1 commit into
Open
Require job access in revisions_info before disclosing component revisions#5431herdiyana256 wants to merge 1 commit into
herdiyana256 wants to merge 1 commit into
Conversation
…sions The revisions_info handler is decorated with @handler.oauth, which authenticates the caller but does not authorize access to a specific job. It read the `job` request parameter and returned the component/repo/revision list for that job with no access check, so any authenticated caller could disclose the build composition (source components, repo URLs and revisions) of an arbitrary job, including jobs and projects they are not authorized for. Gate the lookup on access.has_access(job_type=job) and validate the job name, matching the other job-scoped handlers (coverage_report, fuzzer_stats). The core logic moves into get_component_revisions_list so the access-denied path is covered by a unit test.
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.
revisions_inforeads a job name from the request and returns that job's component revision list, decorated only with@handler.oauthand with no job-access check:The result is per-job build data (the source components, their repo git URLs, and the revisions between two builds), so it should be gated on job access the way
coverage_reportandfuzzer_statsare.@handler.oauthauthenticates the caller but does not authorize an arbitrary job, so without a check any caller could disclose the build composition of a job, and its project, they cannot otherwise access.The logic is refactored into
get_component_revisions_list, which validates the job name and requires job access before disclosing anything. Adds a regression test for the access-denied path.