Persistent XSS on public wiki pages
A public wiki page rendered an HTML file containing a script tag, executing attacker-supplied JavaScript in the victim's browser. Because the site lacked a content security policy, the script could read the user's API token and use it to act as the victim.
- Triaged in under an hour
- Fixed in 42 days
- Disclosed after 3 months
Details
There's a persistent cross-site scripting (XSS) vulnerability in the wiki pages. This can lead to an account take over via the leaked API token.
Proof of concept
As an attacker, create a new public repository. Make sure you have a client that is allowed to push to that repository. For this PoC, lets say the repository is located at [email protected]/dummy/test.git. On the client, execute the following commands:
git clone [email protected]/dummy/test.git cd test echo "<script>alert('Hello world!');</script>" > index.html git add index.html git commit -m "This message is super important" git push
Now go to https://gitlab.com/dummy/test/wikis/index.html. As you will see, this executes the JavaScript that is stored in the file.

Impact
GitLab doesn't have a content security policy, which means that clients allow inline Javascript to be executed. This gives access to the current user its API token. The API token can be used to access the user its projects, do actions as the user, give access to potential confidential information, etc.
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 wiki rendered uploaded HTML files without sanitising or serving them with a restrictive content type, and no content security policy blocked inline scripts.
Impact
An attacker could execute JavaScript in a victim's browser to steal their API token and then use it to access projects, perform actions as the user, and reach confidential information.
What the attacker needed
A GitLab account; ability to create a public repository; victim visits the crafted wiki page
How it was found
- Create a new public repository and ensure you can push to it.
- Clone the repository locally.
- Create an HTML file containing a script tag and commit it.
- Push the commit to the repository.
- Visit the wiki page for that HTML file to trigger the script.
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.
A wiki page displayed a file as a web page without removing dangerous code. When a victim visited that page, the code ran in their browser and could steal their login token, letting the attacker act as them.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.