Skip to content
XSS Disclosed report Beginner

Stored XSS in DataDog Integration affects maintainers/owners

The Datadog integration settings page rendered the 'Datadog site' value into an HTML help link without sanitisation, allowing a stored cross-site scripting payload. An attacker with permission to edit the integration could execute script in the browser of any maintainer or owner who visited the settings page.

GitLab

Originally disclosed on GitLab

  • Fixed in 41 days
  • Disclosed after 41 days

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

Ruby
   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:

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The value of the Datadog site setting was interpolated into an HTML help string without sanitisation before rendering.

Impact

Stored XSS could run script in the browser of maintainers or owners who visited the Datadog integration settings page.

What the attacker needed

Permission to edit the Datadog integration; victim visits the integration settings page

How it was found

  1. Open the Datadog integration settings page for a project (requires permission).
  2. Set the Datadog site field to a value containing an HTML script tag and save.
  3. The stored script executes when the settings page is loaded; send the link to victims.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a web page shows user-supplied text, it must escape special characters so the browser treats it as text, not code. Here the 'Datadog site' setting was inserted into a link without that escaping, so a value containing HTML tags ran as JavaScript. Anyone who could change that setting could make the script run in the browser of a project maintainer or owner who opened the page.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.