Skip to content
Crypto Disclosed report Advanced

Length extension attack leading to HTML injection

b1t Follow

Originally disclosed on HackerOne

Bounty$100 Medium View original
  • Fixed in 13 days
  • Paid in 20 days
  • Disclosed after 43 days

At the profile setting page where I can set my personal website I found this url: https://www.zomato.com/redirect?u=xxx&t=yyy Where xxx is the url that we can control and yyy is the hash. Through out blackbox testing I find out that if md5(somescret + url) == t then the redirect is allowed. This is vulnable to https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks. With this vulnerability I can append what ever I want into the url in u variable. https://www.zomato.com/redirect?u=http%3A//a.c%80%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%E8%00%00%00%00%00%00%00%3Cstyle%3Ebody%7Bbackground-color%3A%20black%3B%7D%3C/style%3E%3Cmarquee%20bgcolor%3D%23000000%3E%3Cfont%20color%3D%2300FF00%3Eb1t%20%3D%2C%3D%3C/font%3E%3C/marquee%3E&t=cb3efc9cbeb3d7b84dfc5cb2bef5a3c4. As a result I can inject arbitrary HTML content into your page because of the Redirecting you to... message and there is no escaping on this page. At first I was aiming at an XSS but your WAF blocks all my attemps, a more skilled attacker may be able to bypass it. Because the nullbyte in url breaks your Refresh header the page won't redirect anymore and display my injected content. Visit the poc above and look at the request and response you will have a clearer view of what happened. A correct fix for this would be using a correct ``HMAC implementation not just simple md5(secret+message). There is an attachment script below which I used to exploit the vulnerability. You have get https://github.com/iagox86/hash_extender to be able to use the script.

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

What is known

A medium-severity crypto bug in Eternal. HackerOne made it public on 1 September 2017. It paid $100.

About Crypto

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from Eternal

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.