silverstripe/silverstripe-subsites — pull request #149 by silverstripe-elliot (2014-07-14 05:26:35+00:00)
Title: Sanitise domain name field to prevent XSS attack on the CMS

PWC identified an issue with the subsites module that would allow someone with authenticated access to attack other CMS users, such as stealing the session ID and hijacking an authenticated user's session.
I can't imagine a case where HTML would ever be allowed in the subdomain of a website, so it's a good practice to strip it out anyway.

Steps to reproduce the original issue:
1. Enter a subsite name and mark as the default site.
2. Add a new domain named and mark it as primary
3. Switch to the new subsite.
4. Make a new Page. This will execute a javascript alert containing "2".