Skip to content
XSS Disclosed report Beginner

[RDoc] XSS in project README files

RDoc markup in a project README file allowed a stored JavaScript payload to be injected, which would execute when a user clicked a crafted link. An attacker could run arbitrary JavaScript in the context of a victim's session.

ysx Follow

Originally disclosed on HackerOne

  • Triaged in 7 hours
  • Fixed in 22 days
  • Disclosed after 22 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,

While experimenting with parser bypass techniques, I discovered that RDoc markup could be used to inject a stored JavaScript payload into a project README.rdoc file.

Please note that this issue is separate to my earlier report #200565 (XSS with AsciiDoc markup), marked as duplicate.

Steps to Reproduce

  1. Create a new GitLab project
  2. Initialise the project by creating a README file
  3. Set the file title to README.rdoc
  4. Paste the below Payload into the file
  5. Commit the file to the project and click on the "XSS" link

Proof of Concept Payload

XSS[JaVaScriPt:alert(1)] <-- click to test

Thanks!

The original report as published on HackerOne, by ysx. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 RDoc renderer did not properly sanitise link targets, allowing a javascript: URI to be included in the generated HTML.

Impact

An attacker could run JavaScript in a victim's browser when the victim clicks a crafted link in a README file.

What the attacker needed

A GitLab account; victim clicks a link in the README

How it was found

  1. Create a new GitLab project
  2. Initialise the project by creating a README file
  3. Set the file title to README.rdoc
  4. Paste the payload into the file
  5. Commit the file to the project and click on the XSS 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.

Some websites let you write documentation using simple formatting languages like RDoc. The researcher found that a link written in RDoc could contain JavaScript code instead of a normal web address. When someone clicked that link, the code would run in their browser, which is called cross-site scripting (XSS).

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by ysx

View all

25 more disclosed reports, best first.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.