XSS in whois
Like many other text only protocols XSS is often overlooked in whois.
The rational behind this is simple, browsers aren't meant to query
whois information. I have suspected that it's been possible for some time, but it wasn't until I did a whois on a domain registered through privacy--protect.com that I saw it in the wild for the first time.
Notice the <script>open('http://privacy--protect.org/');</script> line? It causes a popup window to open if you query this through most web based whois clients.In all the previously posted material regarding XSS in whois there has been a call for the registrar to filter special characters in the registrant details. That is wrong! Whois is a text based protocol and in accordance with RFC 954 there is no need to filter input or encode output.The highlighted code in the example above is provided by the whois server itself, after the registrant details. Further more, the following is a valid whois query, but will lead to XSS in web based whois clients:
$ whois anireactor.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: ANIREACTOR.COM
Registrar: HEBEI INTERNATIONAL TRADING ( SHANGHAI) CO., LTD
Whois Server: whois.hebeidomains.com
Referral URL: http://www.hebeidomains.com
Name Server: NS1.ISAACHOST.COM
Name Server: NS2.ISAACHOST.COM
Status: clientTransferProhibited
Updated Date: 09-jan-2010
Creation Date: 09-jan-2010
Expiration Date: 09-jan-2011
>>> Last update of whois database: Thu, 28 Jan 2010 05:59:01 UTC <<<
NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.
TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.
The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.
Domainname: ANIREACTOR.COM
Registrant:
ANIREACTOR.COM
Privacy--Protect.org
P.O. Box 98
Note - All Postal Mails Rejected, visit Privacy--Protect.org
5066 Moergestel
The Netherlands
Tel.: +55.1137117371
Email: ANIREACTOR.COM (at) privacy--protect.org
Administrative:
ANIREACTOR.COM
Privacy--Protect.org
P.O. Box 98
Note - All Postal Mails Rejected, visit Privacy--Protect.org
5066 Moergestel
The Netherlands
Tel.: +55.1137117371
Email: ANIREACTOR.COM (at) privacy--protect.org
Technical:
ANIREACTOR.COM
Privacy--Protect.org
P.O. Box 98
Note - All Postal Mails Rejected, visit Privacy--Protect.org
5066 Moergestel
The Netherlands
Tel.: +55.1137117371
Email: ANIREACTOR.COM (at) privacy--protect.org
Legal note:
PRIVACY--PROTECT.ORG is providing privacy protection services to
this domain name to protect the owner from spam and phishing attacks.
Privacy--Protect.org is not responsible for any of the activities
associated with this domain name. If you wish to report any abuse
concerning the usage of this domain name, you may do so at
http://privacy--protect.org/. We have a stringent abuse policy and
any complaint will be actioned within a short period of time.
<script>open('http://privacy--protect.org/');</script>
The data in this whois database is provided to you for information
purposes only, that is, to assist you in obtaining information about
or related to a domain name registration record. We make this information
available "as is", and do not guarantee its accuracy. By submitting a
whois query, you agree that you will use this data only for lawful purposes
and that, under no circumstances will you use this data to:
(1) enable high volume, automated, electronic processes that stress
or load this whois database system providing you this information; or
(2) allow, enable, or otherwise support the transmission of mass unsolicited,
commercial advertising or solicitations via direct mail, electronic mail,
or by telephone.
The compilation, repackaging, dissemination or other use of this data is
expressly prohibited without prior written consent from us. The Registrar
of record is HebeiDomains.com. We reserve the right to modify these terms
at any time. By submitting this query, you agree to abide by these terms.
Request number 1 from 5 daily allowed from your IP address.
Email to trick bots (does not work) [email protected]
Notice the <script>open('http://privacy--protect.org/');</script> line? It causes a popup window to open if you query this through most web based whois clients.In all the previously posted material regarding XSS in whois there has been a call for the registrar to filter special characters in the registrant details. That is wrong! Whois is a text based protocol and in accordance with RFC 954 there is no need to filter input or encode output.The highlighted code in the example above is provided by the whois server itself, after the registrant details. Further more, the following is a valid whois query, but will lead to XSS in web based whois clients:
$ whois "<script>alert('xss');</script>.com"Therefore, the only sane solution is to do the filtering on the web client side!
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
No match for "<SCRIPT>ALERT('XSS');</SCRIPT>.COM".
>>> Last update of whois database: Sat, 30 Jan 2010 10:21:07 UTC <<<
NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar. Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.
TERMS OF USE: You are not authorized to access or query our Whois
database through the use of electronic processes that are high-volume and
automated except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, you agree to abide
by the following terms of use: You agree that you may use this Data only
for lawful purposes and that under no circumstances will you use this Data
to: (1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
that apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.
The Registry database contains ONLY .COM, .NET, .EDU domains and