Stored XSS via Zoom meeting url on project import
The Zoom URL validator only checked that the field contained a valid Zoom link, not that the entire field was a valid URL. An attacker could import a project with a malicious javascript: URL in the Zoom meeting field, leading to stored XSS when a user clicked the 'Join Zoom meeting' link.
GitLab
Originally disclosed on GitLab
- Fixed in 8 months
- Disclosed after 8 months
HackerOne report #832117 by vakzz on 2020-03-26, assigned to @rchan-gitlab:
Summary
When importing a project that has an issue with a zoom meeting, the ZoomUrlValidator only checks to see if the url fields contains a valid url not that the whole field is a valid url. This allows a url such as javascript:alert(document.domain);//https://zoom.us/my/5556 to pass the validation and to be set as the href of the Join Zoom meeting link.
class ZoomUrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return if Gitlab::ZoomLinkExtractor.new(value).links.size == 1
record.errors.add(:url, 'must contain one valid Zoom URL')
end
end
class ZoomLinkExtractor
ZOOM_REGEXP = %r{https://(?:[\w-]+\.)?zoom\.us/(?:s|j|my)/\S+}.freeze
def initialize(text)
[@]text = text.to_s
end
def links
[@]text.scan(ZOOM_REGEXP)
end
def match?
ZOOM_REGEXP.match?([@]text)
end
end
Steps to reproduce
- Create a new project
- Add an issue
- Add a comment with
/zoom https://zoom.us/my/5556to add a zoom meeting - Export the project
- Change the
urlattribute of the zoom meeting inproject.jsonto bejavascript:alert(document.domain);//https://zoom.us/my/5556" - Import the project
- Command/Control clicking the
Join zoom meetingbutton will trigger the payload in Chrome/Firefox or a regular left click in Safari/Edge
Demo
Examples
This also happens on gitlab.com but is blocked due to the CSP
https://gitlab.com https://gitlab.com/vakzz-h1/zoom_xss/-/issues/1

What is the current bug behavior?
The url of a ZoomMeeting can be anything so long as it contains a valid zoom link somewhere inside it.
What is the expected correct behavior?
The url of a ZoomMeeting should be a valid zoom url.
Output of checks
Results of GitLab environment info
System information
System: Ubuntu 18.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.6.5p114
Gem Version: 2.7.10
Bundler Version:1.17.3
Rake Version: 12.3.3
Redis Version: 5.0.7
Git Version: 2.24.1
Sidekiq Version:5.2.7
Go Version: unknown
GitLab information
Version: 12.8.7-ee
Revision: 2643fd87200
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 10.12
URL: http://gitlab-vm.local
HTTP Clone URL: http://gitlab-vm.local/some-group/some-project.git
SSH Clone URL: [email protected]:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 11.0.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git
Impact
If a user clicks the link then the attacker could execute requests on behalf of the user
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
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 validator used a regular expression to check if the input contained a Zoom URL, rather than verifying that the entire input was a valid Zoom URL.
Impact
If a user clicks the link, the attacker could execute requests on behalf of the user; on gitlab.com the exploit is blocked by CSP.
What the attacker needed
Attacker can import a project; victim clicks the Join Zoom meeting link
The fix
The validator should be changed to ensure the entire URL is a valid Zoom URL, not just that it contains one.
How it was found
- Create a new project
- Add an issue
- Add a comment with `/zoom https://zoom.us/my/5556` to add a zoom meeting
- Export the project
- Change the `url` attribute of the zoom meeting in `project.json` to a malicious javascript URL that also contains a valid Zoom link
- Import the project
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.
This report is about a security flaw in GitLab where a user could import a project containing a malicious link disguised as a Zoom meeting URL. When another user clicked that link, harmful code could run in their browser, potentially letting the attacker act as the victim. The problem was that the validation only looked for a Zoom link somewhere in the text, not that the whole text was a safe link.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.