Skip to content
XSS Disclosed report Intermediate

Self-XSS can be achieved in the editor link using filter bypass

The editor link feature allowed a filter bypass by using special keywords like %(branch)s, which could be replaced with a branch name such as 'javascript', leading to self-XSS when the source code link was clicked. An attacker could execute arbitrary JavaScript in their own browser context.

sp1d3rs Follow

Originally disclosed on HackerOne

Informational View original
  • Fixed in 10 hours
  • Disclosed after 15 days

Summary by the researcher

This issue was reported just because of incomplete #223692 fix, just for fun. The % character could be also used besides %(<keyword>)s with encoded characters like %00, %09 etc in the FORBIDDEN_URL_SCHEMES, which could lead to another filter bypass in some browsers. The solution was an additional check in the FORBIDDEN_URL_SCHEMES.

The report

##Description I saw the fixed issue in the https://hackerone.com/reports/223692 and i think i found another filter bypass. I noticed that we actually can use special keywords like %(branch)s, %(file)s and %(line)s. So XSS can be achieved in this way: %(branch)s:alert(1);//https:// if the branch will be named javascript, the payload will be executed upon pressing the source code link of the file inside it.

##Steps to reproduce

  1. Create some branch and name it javascript
  2. Put some source files.
  3. Click the link on source file. The %(branch)s will be replaced by branch name (javascript) and popup will be fired.

##Suggested fix I recommend you to additionally sanitize string by disallowing special symbolst before first : occurence (if exist)

Attachments

zx.JPG
zx.JPG From the original on HackerOne

The original report as published on HackerOne, by sp1d3rs. 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 filter for forbidden URL schemes did not account for special placeholder keywords like %(branch)s that could be replaced with a dangerous scheme such as 'javascript'.

What the attacker needed

Ability to create a branch; user clicks the source file link

The fix

The fix was an additional check in the FORBIDDEN_URL_SCHEMES to block such bypasses.

How it was found

  1. Create a branch and name it 'javascript'.
  2. Add some source files to the branch.
  3. Click the link on a source file, which triggers the placeholder replacement and executes 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.

This is a self-XSS bug where the user runs malicious code in their own browser. The editor link feature allowed special placeholders that could be filled with text like a branch name, bypassing the dangerous URL scheme filter. Clicking a crafted link executed the script.

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 sp1d3rs

View all

62 more disclosed reports, best first.

More from Weblate

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.