Skip to content
Open redirect Disclosed report Intermediate

Bypass Open Redirect on Live preview WEB Ide opening

The Live Preview feature in GitLab's Web IDE allowed an open redirect bypass using a crafted URL that passed validation. An attacker could redirect users to an arbitrary domain.

GitLab

Originally disclosed on GitLab

  • Fixed in 9 days
  • Disclosed after 9 days

HackerOne report #1613430 by otoyyy on 2022-06-25, assigned to @rshambhuni:

Report | Attachments | How To Reproduce

Report

NOTE! Thanks for submitting a report! Please note that initial triage is handled by HackerOne staff. They are identified with a HackerOne triage badge and will escalate to the GitLab team any. Please replace all the (parenthesized) sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!

Summary

I would like to report a Bypass Open Redirect vulnerability in the Live Preview feature. Using the payload https://[email protected]@evil.com can bypass the fix that has been made in the reports at https://hackerone.com/reports/437142 .

The open function is still a lot of vulnerability in this problem, But if we use opener it has a strong defense.

Steps to reproduce

(Step-by-step guide to reproduce the issue, including:)
To verify the vulnerability, I have prepared an if file here https://gitlab.com/-/ide/project/testt1111/poc/edit/main/-/hey.js.

If you want to replicate you can use the steps below:

  1. Create create.json
{
   "main": "hey.js",  
   "dependencies": {  
     "vue": "latest"  
   }  
}
  1. Create hey.js

Payload : opener("https://[email protected]@evil.com");

  1. Open it using Open in Web Ideas.

  2. Select Live Preview.

Impact

Bypass Open Redirect to redirect other users to the attacker's domain.

Examples

(If the bug is project related, please create an example project and export it using the project export feature)

(If you are using an older version of GitLab, this will also help determine whether the bug has been fixed in a more recent version)

(If the bug can be reproduced on GitLab.com without violating the Rules of Engagement as outlined in the program policy, please provide the full path to the project.)

What is the current bug behavior?

The open javascript function is still a lot of vulnerability in the Ide Web feature. But the opener function can't make open redirect to attacker url.

What is the expected correct behavior?

The open function does not make open redirect to an external URL.

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info)

(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)

Impact

Bypass Open Redirect to redirect other users to the attacker's domain.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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

Likely the URL validation for the Live Preview feature did not properly handle URLs with multiple '@' symbols, allowing a bypass of the open redirect protection.

Impact

An attacker could redirect users to a malicious domain, bypassing the previous open redirect fix.

What the attacker needed

Victim opens a crafted project in Web IDE; victim selects Live Preview

How it was found

  1. Create a file named create.json with a main entry pointing to hey.js and a dependency on vue.
  2. Create a file named hey.js containing a call to the opener function with a crafted URL.
  3. Open the project in the Web IDE.
  4. Select Live Preview to trigger the redirect.

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.

An open redirect is when a website sends you to another site without checking if that site is safe. Here, a specially crafted link could make GitLab's Live Preview send you to an attacker's website, even though a previous fix tried to stop this.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.