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
  • #336614
Closed
Open
Issue created Jul 21, 2021 by GitLab SecurityBot@gitlab-securitybotReporter

Stored XSS in DataDog Integration affects maintainers/owners

HackerOne report #1257383 by shells3c on 2021-07-11, assigned to GitLab Team:

Report | How To Reproduce

Report

Summary

The code: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/integrations/datadog.rb

   def fields  
    ...  
    {  
          type: 'password',  
          name: 'api_key',  
          title: _('API key'),  
          non_empty_password_title: s_('ProjectService|Enter new API key'),  
          non_empty_password_help: s_('ProjectService|Leave blank to use your current API key'),  
          help: "<a href=\"#{api_keys_url}\" target=\"_blank\">API key</a> used for authentication with Datadog",  
          required: true  
    }

    ...

    def api_keys_url  
      return URL_API_KEYS_DOCS unless datadog_site.presence

      sprintf(URL_TEMPLATE_API_KEYS, datadog_site: datadog_site)  
    end

The api_keys_url is not sanitized before being rendered, leads to XSS, affects any maintainer/owner of the project when they visit the DataDog Integration

Steps to reproduce
  1. Go to DataDog Integration setting: https://gitlab.com/:user:/:project:/-/services/datadog/edit (requires permission)
  2. In the Datadog site field, set the value to "><script>alert()</script>, then Save
  3. Now XSS will be activated in https://gitlab.com/:user:/:project:/-/services/datadog/edit, send this link to victims

Impact

Stored XSS affects maintainers/owners

How To Reproduce

Please add reproducibility information to this section:

Assignee
Assign to
Time tracking