Domain Takeover - gl-canary.freetls.fastly.net
A domain whitelisted in GitLab's Content Security Policy could be claimed by any Fastly customer, allowing an attacker to host malicious scripts on it. This could bypass the CSP and enable client-side code execution if an XSS vulnerability exists.
- Triaged in 4 days
- Fixed in 11 months
- Paid in 3 months
- Disclosed after 3.6 years
Hello Gitlab!
The domain gl-canary.freetls.fastly.net is whitelisted in gitlab.com Content Security Policy. See Content-Security-Policy HTTP header from gitlab.com:
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-bjSllX/7AnVrXL1QQxsb+w=='; 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:
This domain can be controlled from any fastly.com account:
- Register at https://www.fastly.com/signup
- Go to https://manage.fastly.com/services/all
- Create a new service
- Use
gl-canary.global.ssl.fastly.netas domain. (Fastly automatically creates <name>.freetls.fastly.net. See https://docs.fastly.com/en/guides/setting-up-free-tls#support-for-http2-ipv6-and-tls-12) - Configure hosts
Impact
An attacker can use the domain to bypass the CSP and execute malicious client-side code (for example, the client application may have an XSS vulnerability). The domain could potentially be used elsewhere in Gitlab application (CDN, for example).
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
Impact
An attacker could bypass the CSP and execute malicious client-side code, potentially exploiting an XSS vulnerability, and the domain might be used elsewhere in GitLab.
What the attacker needed
A free Fastly account; an XSS vulnerability to exploit
How it was found
- Register for a free Fastly account.
- Go to the Fastly service management page.
- Create a new service.
- Use the specified Fastly domain name as the service domain.
- Configure the hosts.
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.
GitLab allowed a Fastly domain in its CSP, but any Fastly customer could claim it. If an attacker did, they could host scripts there, which could bypass the CSP if an XSS flaw exists.
What is Subdomain takeover?
A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.