Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 54.9k
    • Issues 54.9k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1.5k
    • Merge requests 1.5k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #372120
Closed
Open
Issue created Aug 30, 2022 by Furkan Ayhan@furkanayhan💡Maintainer

Prefill variables do not check permission of the project in external CI config

Summary

An attacker can access other projects' top-level YAML variables which use description via using external CI config and prefill variables.

I found this vulnerability when working on #353456 (closed).

The vulnerability was introduced by #336184 (closed) in v14.4.

p.s. this does not affect the new GraphQL endpoint because we missed the implementation of this external project feature (!93387 (merged)).

Steps to reproduce

  1. Project 1: Private, has a .gitlab-ci.yml file with some top-level YAML variables.
variables:
  VAR1:
    value: my secret 1
    description: this is my var 1
  VAR2: my secret 2

test:
  script: exit 0
  1. Project 2: Public/Private, has an external "CI/CD configuration file".

Screenshot_2022-08-30_at_14.39.42

  1. In Project 2, open the Pipeline Run page and see;

Screenshot_2022-08-30_at_14.40.47

Possible fixes

  1. Move the external project logic from app/controllers/projects/pipelines_controller.rb to app/services/ci/list_config_variables_service.rb.
  2. Use the same logic in lib/gitlab/ci/pipeline/chain/config/content/external_project.rb.
Edited Sep 01, 2022 by Furkan Ayhan
Assignee
Assign to
Time tracking