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.
- 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
- Create some branch and name it javascript
- Put some source files.
- Click the link on source file. The
%(branch)swill 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

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
- Create a branch and name it 'javascript'.
- Add some source files to the branch.
- 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.