All Projects → Nhoya → PastebinMarkdownXSS

Nhoya / PastebinMarkdownXSS

Licence: other
XSS in pastebin.com and reddit.com via unsanitized markdown output

Projects that are alternatives of or similar to PastebinMarkdownXSS

Bxss
bXSS is a utility which can be used by bug hunters and organizations to identify Blind Cross-Site Scripting.
Stars: ✭ 331 (+294.05%)
Mutual labels:  xss, infosec, bugbounty
Pentesting
Misc. Public Reports of Penetration Testing and Security Audits.
Stars: ✭ 24 (-71.43%)
Mutual labels:  vulnerability, infosec, bugbounty
Android Reports And Resources
A big list of Android Hackerone disclosed reports and other resources.
Stars: ✭ 590 (+602.38%)
Mutual labels:  xss, infosec, bugbounty
Application Security Engineer Interview Questions
Some of the questions which i was asked when i was giving interviews for Application/Product Security roles. I am sure this is not an exhaustive list but i felt these questions were important to be asked and some were challenging to answer
Stars: ✭ 267 (+217.86%)
Mutual labels:  xss, vulnerability, infosec
Blackwidow
A Python based web application scanner to gather OSINT and fuzz for OWASP vulnerabilities on a target website.
Stars: ✭ 887 (+955.95%)
Mutual labels:  xss, vulnerability, bugbounty
APSoft-Web-Scanner-v2
Powerful dork searcher and vulnerability scanner for windows platform
Stars: ✭ 96 (+14.29%)
Mutual labels:  xss, vulnerability
SuperLibrary
Information Security Library
Stars: ✭ 60 (-28.57%)
Mutual labels:  infosec, bugbounty
urldedupe
Pass in a list of URLs with query strings, get back a unique list of URLs and query string combinations
Stars: ✭ 208 (+147.62%)
Mutual labels:  infosec, bugbounty
goverview
goverview - Get an overview of the list of URLs
Stars: ✭ 93 (+10.71%)
Mutual labels:  infosec, bugbounty
flydns
Related subdomains finder
Stars: ✭ 29 (-65.48%)
Mutual labels:  infosec, bugbounty
dora
Find exposed API keys based on RegEx and get exploitation methods for some of keys that are found
Stars: ✭ 229 (+172.62%)
Mutual labels:  infosec, bugbounty
Astra
Astra is a tool to find URLs and secrets inside a webpage/files
Stars: ✭ 187 (+122.62%)
Mutual labels:  infosec, bugbounty
T1tl3
A simple python script which can check HTTP status of branch of URLs/Subdomains and grab URLs/Subdomain title
Stars: ✭ 14 (-83.33%)
Mutual labels:  infosec, bugbounty
magicRecon
MagicRecon is a powerful shell script to maximize the recon and data collection process of an objective and finding common vulnerabilities, all this saving the results obtained in an organized way in directories and with various formats.
Stars: ✭ 478 (+469.05%)
Mutual labels:  infosec, bugbounty
PayloadsAll
A list of useful payloads and bypass for Web Application Security and Pentest/CTF
Stars: ✭ 31 (-63.1%)
Mutual labels:  vulnerability, bugbounty
rejig
Turn your VPS into an attack box
Stars: ✭ 33 (-60.71%)
Mutual labels:  infosec, bugbounty
lit-bb-hack-tools
Little Bug Bounty & Hacking Tools⚔️
Stars: ✭ 180 (+114.29%)
Mutual labels:  infosec, bugbounty
osmedeus-workflow
Community Workflow for the Osmedeus Engine that describes basic reconnaissance methodology for you to build your own
Stars: ✭ 26 (-69.05%)
Mutual labels:  infosec, bugbounty
XSS-Payload-without-Anything
XSS Payload without Anything.
Stars: ✭ 74 (-11.9%)
Mutual labels:  xss, bugbounty
Subcert
Subcert is an subdomain enumeration tool, that finds all the subdomains from certificate transparency logs.
Stars: ✭ 58 (-30.95%)
Mutual labels:  infosec, bugbounty

Markdown XSS in pastebin.com and reddit.com

XSS via unsanitized markdown output in pastebin.com and reddit.com

We all love Markdown, right? It's a fast and user-friendly way to beautify our documentation. Well, all that glitters is not gold, in this case not for system administrators. Some time ago playing the Hack.lu 2017 CTF event with my team we solved an interesting challenge called Mitsune were a misconfigured instance of mitsune was given and we had to send a malicious link containing an XSS payload to an administrator to steal their cookies. You can find two writeup with different approaches here and here.

After the end of the CTF, my teammate Donato Onofri and I started to investigate more on how this vulnerability affects worldwide markdown services and we ended up with multiple reports (here, here and here) But as you can see all of those are relatively small services.

The pastebin case

During my investigation I found that even pastebin was affected by this kind of vulnerability.

When we create a new paste we can select which language to use for the syntax highlight. In this list there is also a Premium only pick for Markdown parsing, let's try it.

highlight

First I tried to send a simple HTML body to see if it's interpreted but without success.

I also tried a simple payload using [link](<script>alert(1)</script>) but apparently the script tag is not interpreted neither. Lastly I tried the old trick we used to solve the Mitsune challenge: we used a base64 payload and the content-type base64 to let the javascript handle the decoding and the execution. I crafted a new markdown link entity, containing the following payload:

[clickme](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pgo=)

and I generated a new paste. Clicking on the link I finally got an alert, confirming that my payload was working.

PoC1_2 PoC

The cool part is that you need a premium account to generate the paste but you can send it with anyone :)

The second PoC

Some time after I found and reported the vulnerability I finally received an email from the pastebin administrators claiming that they patched it.

I gave it a look and found that they blocked the data entity and my old PoC was no longer working.

To confirm that the problem was solved I created another paste with a simpler payload

[totallyharmlesslink](javascript:window.onerror=alert;throw%201)

and, again, I got an alert :D

Second PoC

Conclusion

Markdown XSS are real and tons of services are affected due to unsanitized output. If you maintain a project that is using a markdown parser I suggest you to read this, if you are a pentester or a bug hunter I suggest you to starting consider this kind of vulnerability (I even got a CVE :P)

Fun fact: during an event, I was talking about CTFs and someone told me: "I don't play CTFs because they are not real world scenarios" :)

Note: As pointed out here the first payload,on recent browsers, will lose the context of the webpage where it was triggered.

BONUS

Publishing this writeup on reddit.com we found out that the new interface was affected by this vulnerability :)

Timeline

  • 22/12/17 Vulnerability found
  • 23/12/17 Vulnerability reported
  • 24/12/17 First contact with the administrators, they were kind enough to provide me with a premium lifetime account and the promise to patch ASAP
  • 02/04/18 I sent a mail to the administrators to solicit the patch and ask information about the disclosure details
  • 10/04/18 I received a mail saying that the vulnerability was patched
  • 10/04/18 I sent a reply containing a new PoC with a bypass for the current patch
  • 11/04/18 Patch for the second PoC released
  • 13/04/18 Vulnerability found on reddit.com
  • 13/04/18 Vulnerability reported to reddit team
  • 13/04/18 First hotfix released
  • 23/04/18 Final path deployed

Interested in my works?

Follow me on twitter @0x7a657461 and linkedin 0xzeta

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].