My book starts off with a discussion of cross-site scripting (XSS) attacks along with examples from 2009 that illustrate the simplicity of these attacks and the significant impact they can have. What’s astonishing is how little many of the attacks have changed.
Consider the following example, over a decade old, of HTML injection before the term XSS became so ubiquitous. The exploit also appeared about two years before the blanket CERT advisory that called attention to the insecurity of unchecked HTML (CA-2000-02)1.
We have just found a serious security hole in Microsoft’s Hotmail service (https://www.hotmail.com/) which allows malicious users to easily steal the passwords of Hotmail users.
The discoverers flouted the 90s trend to name vulns based on expletives or num3r1c characters and dubbed it simply the “Hot”Mail Exploit.
Disclosures of that era also tended to include greetz, typos, and self-aggrandizement about the hacker’s near-omnipotent skills. This disclosure skipped those aspects. However, the demo site satisfied an axiom of hacking culture by using a hacker handle that referenced pop culture, Blue Adept, a fantasy novel by Piers Anthony.
The attack required two steps. First, they set up a page on Geocities (a hosting service for web pages distinguished by being free before free was subsumed by the Web 2.0 label) that spoofed Hotmail’s login.
The attack wasn’t particularly sophisticated and it didn’t need to be. The login form collected the victim’s credentials and IP address, then mailed them to the newly-created Geocities account.
The second step involved executing the exploit against Hotmail by sending an email with HTML that contained a rather curious
img tag. (Whitespace added for readability of the long, double-quoted string.):
Modern attacks might have more sophisticated obfuscation techniques and use tags other than the
img element, but it’s otherwise hard to distinguish what decade this payload is from.
What’s also entertaining is how timeless the “serious security concern” is from the original disclosure. They list four points, which I’ve only edited for a typo:
- The malicious code runs as soon as e-mail message is viewed
- The resources required to launch the attack are minimal and freely available.
- The malicious e-mail can be sent from virtually anywhere, including libraries, internet cafes, or classroom terminals
The reference to internet cafes gives away the era, but otherwise this description from 1998 sounds like it could be from today. (I also have an example from 1996.)
The problem of HTML injection, well known for over 10 years, remains a common vuln.
(Another edit from the future: XSS still remains a common vuln 25 years after this disclosure. Although I’m optimistic about its decline due to frameworks like React.)
To this day I dislike the framing of XSS as an input validation issue. Accept any characters you want – that’s not the issue! The flaw is output encoding and not handling those characters correctly for the context in which they’re being rendered. ↩