Html Injection and Possible XSS in sms-be-vip.twitter.com
The 404 error page on sms-be-vip.twitter.com reflected HTML tags from the URL path without encoding them, so a crafted link could inject markup into the page. In Internet Explorer, with its XSS filter disabled, this could allow script execution in the site's origin.
- Triaged in 17 days
- Fixed in 18 days
- Paid in 21 days
- Disclosed after 51 days
Hi, I would like to report HTML Injection and possible cross site scripting (XSS) vulnerability in sms-be-vip.twitter.com
##Overview
The sms-be-vip.twitter.com 404 error page appears to be vulnerable to XSS and HTML Injection as it doesn't encode the HTML tags in the path name such as https://sms-be-vip.twitter.com/<h1>TEST</h1>.
But the HTML tags have to be send without URL encoding. Most of the modern web browsers will encode the HTML tags in the request before it being sent to the webserver. However In Internet Explorer 11 and lower versions it's possible to make the browser send the request without any URL encoding.
How to make MSIE 7 - 11 send the request without URL encoding ?
Internet Explorer won't encode the URL if it was sent from a 302 Redirect.
So you can use a simple PHP page like the following:
<?php
$url = $_GET['x'];
header("Location: $url");
?>
Then use the page and perform a redirection to the endpoint which is vulenrable to XSS.
http://secgeek.net/POC/redir.php?x=https://sms-be-vip.twitter.com/<h1>TEST</h1>
Now you could notice that the friendly HTTP error messages in Internet Explorer will appear instead of showing the <h1>TEST</h1> in the error page.
There is a simple workaround for this issue. According to Microsoft the HTTP friendly error message will appears if it meets two criteria
1.The HTTP Status code must be [400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505] 2.The HTTP Response body’s byte length must be shorter than a threshold value
The default threshold value for 404 errors is 512 bytes.
So we can add more data in the request to be returned in the server response that will overcome this issue.
http://secgeek.net/POC/redir.php?x=https://sms-be-vip.twitter.com/<h1>TEST</h1>....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
##Techincal Details
##Impact:
The vulnerability allow a malicious user to inject html tags and execute Javascript in the same context of sms-be-vip.twitter.com domain which could lead to steal user's session, peform CSRF attacks or open a phishing page.
##Affected Domain: sms-be-vip.twitter.com
##Affected Insertion point:
The path name in the url https://sms-be-vip.twitter.com/<XSS Injection here>
##HTML Injection POC http://secgeek.net/POC/Twitter-HTML-POC.php
##XSS POC http://secgeek.net/POC/Twitter-XSS-POC.php
Note: This XSS POC will work only if the XSS Auditor is disabled in Internet Explorer.
I've Attached Sreenshots for the two POCs.
Kindly check and review the issue. Thanks in advance!
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 404 error page reflected the request path into the response body without HTML-encoding it.
Impact
An attacker could inject HTML and, in Internet Explorer with its XSS filter off, run JavaScript in the subdomain's origin, which could lead to session theft, CSRF or a phishing page; the exploit is limited to Internet Explorer and blocked when the XSS Auditor is enabled.
What the attacker needed
Victim uses Internet Explorer 7-11; victim follows a crafted redirect link; XSS Auditor disabled for script execution
How it was found
- Set up a simple redirect page that takes a target URL as a parameter and issues a 302 redirect to it.
- Point the redirect at the vulnerable host with HTML tags in the path, so Internet Explorer forwards the request without URL-encoding.
- Pad the path with extra characters so the response body exceeds Internet Explorer's friendly-error threshold and the injected markup is shown.
- Load the redirect URL in Internet Explorer to see the injected HTML, and with the XSS Auditor disabled to attempt script execution.
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.
When a website shows an error page, it sometimes repeats part of the address you typed back to you. If it does that without cleaning the text first, an attacker can put HTML or JavaScript in the address and have it run as if it came from the site. Here the reporter found that the 404 page on a Twitter subdomain echoed the path without encoding it, but only older Internet Explorer browsers would send the raw tags.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.