email-bugs icon indicating copy to clipboard operation
email-bugs copied to clipboard

Outlook.com on IE9 doesn't prefix CSS rules targeting tag names

Open hteumeuleu opened this issue 8 years ago • 0 comments

On IE9 (or using a Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) user agent), Microsoft serves a different version of Outlook.com.

Outlook.com on IE9

The CSS parser is pretty similar to the one on the regular Outlook.com (prefixing class and id attributes with x_ for example). Except it doesn't prefix CSS rules targeting tag names. At all. So it's possible to target elements from the webmail UI.

The following email hides all table elements and sets the body background in red.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Outlook.com Email bug</title>
	<style>
		body { background:red; }
		table { display: none; }
	</style>
</head>
<body>
	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad, in, accusamus! Qui dolores at magni maiores sunt, laudantium, optio libero ducimus unde reiciendis vero quas deleniti recusandae voluptatibus. Provident, accusantium.</p>
</body>
</html>

hteumeuleu avatar Nov 16 '16 16:11 hteumeuleu