RichText parser vulnerability in scheduled posts allows XSS
The server-side RichText parser for scheduled posts did not validate hyperlinks, so a crafted request could store a link using the javascript scheme. An attacker could then get a victim, such as an admin, to click that link on the scheduled-post edit page and run script in their browser.
Originally disclosed on HackerOne
- Triaged in 15 days
- Fixed in 17 days
- Paid in 15 days
- Disclosed after 17 days
Summary by the researcher
Reddit's MarkDown parser wasn't filtering hyperlinks on server-side in scheduled post feature, which lets attacker to modify a request with normal hyperlink embeding a malicious link using javascript scheme
The report
Summary:
RichText parser is not filtering links when editing scheduled posts
Steps To Reproduce:
- Create a new scheduled post with a link:

image.png From the original on HackerOne - Intercept the request with Burp Suite/Other proxies and replace the link with javascript scheme payload: {

image.png From the original on HackerOne - Navigate to scheduled posts and click Edit:

image.png From the original on HackerOne - Observe the malicious link, if you click on it, the javascript will execute:

image.png From the original on HackerOne
Root cause and possible ways leverage
When submitting a scheduled post, API doesn't validate links, it happens only on the client side and the links can be forged with interception of requests. Though, it seems it is impossible to get the XSS in live post, when submitting the malicious post, reddit turns richtext to markdown and then to html, which automatically removes invalid links. Another possible way to bring it in real post, is to use Link type and also forge the link, but when submitting it will just give an error
Impact
Attacker can trick admins to visit the scheduled editing page and click on malicious link, which results in XSS
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 server trusted client-side link validation and stored the submitted RichText without re-checking the link scheme.
Impact
An attacker could trick an admin into visiting the scheduled-post editing page and clicking the malicious link, resulting in XSS; the text notes the same trick did not work on live posts because the conversion to markdown and HTML removed invalid links.
What the attacker needed
Ability to create a scheduled post; victim clicks the malicious link; request interception tool
How it was found
- Create a new scheduled post containing a link.
- Intercept the request with a proxy and replace the link with a javascript-scheme payload.
- Open the scheduled posts list and click Edit.
- Click the malicious link and observe the script executing.
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 scheduled post is a post you prepare in advance and publish later. The website checked links only in the browser, not on the server, so someone could send a request directly with a link that starts with 'javascript:' instead of 'https:'. Clicking such a link runs code in the page, 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.