[Textile] XSS in project README files
Textile markup in a project README file was not sanitised, so a crafted link could carry a javascript: URL. An attacker could store a script payload in a README that runs in the browser of anyone who views the project page.
- Triaged in 5 hours
- Fixed in 4 days
- Disclosed after 4 days
Summary by the researcher
Persistent XSS vulnerabilities were identified by way of the RubyDoc, reStructuredText, and Textile markup formats. Thanks again to the GitLab team. I've published a blogpost discussing my findings and the recent Security Release.
The report
Hi,
Another parser bypass here – I discovered that Textile markup can be used to inject a stored JavaScript payload into a project README.textile file :)
Steps to Reproduce
- Create a new GitLab project
- Initialise the project by creating a
READMEfile - Set the file title to
README.textile - Paste the below Payload into the file
- Commit the file to the project and click on the link
Proof of Concept Payload
"Security test link":javascript:alert(document.domain)
Thanks!
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 Textile renderer allowed a javascript: URL in a link without validating or sanitising the link target.
Impact
A stored script could run in the browser of any user who viewed the affected project page, though the text does not state what data or actions that script could reach.
What the attacker needed
A GitLab account able to create a project; victim views the project README
How it was found
- Create a new GitLab project
- Initialise the project by creating a README file
- Set the file title to README.textile
- Paste the payload into the file
- Commit the file to the project and click on the link
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 README file can be written in a lightweight formatting language called Textile, which turns plain text into links and headings. The site rendered that formatting without checking the link target, so a link could point to JavaScript code instead of a normal web address. When another user opened the project page, that code ran in their browser as if the site itself had sent it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.