Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | RE: Possible XSS in User-Agent |
|---|---|
| Date: | Mon, 25 Apr 2005 15:22:12 -0400 |
Nicolas,
This is no more an XSS than creating and misusing an arbitrary header:
GET / HTTP/1.1
FooBar: <script>alert();</script>
...
<%=request.getHeader("FooBar")%>
The headers are **always** modifiable by an advanced user, a script-kiddie with
a utility, a clever firewall, a proxy server, etc. Just because information
resides in the header doesn't mean that it doesn't need to be validated, just
like everything else.
This is not a "bug" in any language, browser, or protocol. As per RFC 2616, the
User-Agent field is defined as:
User-Agent = "User-Agent" ":" 1*( product | comment )
Example:
User-Agent: CERN-LineMode/2.15 libwww/2.17b3
So in other words, don't just echo input from the browser back to the user.
This is no more than a trivial example of "Why You Should Validate Your Input".
This could be considered an XSS vector into applications that fail to validate,
but no more so than any other header (or GET/POST variable).
Regards,
Michael Scovetta
Computer Associates
Senior Application Developer
-----Original Message-----
From: Nicolas Montoza [mailto:xonico@gmail.com]
Sent: Monday, April 25, 2005 12:05 AM
To: bugtraq@securityfocus.com; full-disclosure@lists.netsys.com;
news@securiteam.com; bugs@securitytracker.com;
submissions@packetstormsecurity.org; vuln@secunia.com
Subject: Possible XSS in User-Agent
Analyzing User Agent does not make filters of anyone type, being able
to inject xss or HTML.
POC
===
let us suppose that the page we visit has the navigator´s check
You are sailing with Mozila Firefox....
In php, this simply is
<? echo $HTTP_USER_AGENT ?>
then we install any kind of soft which allows us to modify the user
agent, in mozila _firefox you could use this plugin
https://addons.update.mozilla.org/extensions/moreinfo.php?id=59
Example:
USER AGENT: <h1>Soulblack</h1>
USER AGENT:<script>alert('SoulBlack')</script>
it works correctly :).
The logfile of apache ;
127.0.0.1 - - [23/Jan/2006:14:54:02 +0000] "GET /favicon.ico HTTP/1.1"
404 283 "-" "<script>alert('SoulBLack')</script>" "-"
the tests were made with php and apache.
The bug could be in php, or in the protocol , we have not even probe
in another language like asp , etc ...
if the bug resides in the protocol, the model of control of user agent
could be [a-z][0-9] .
Any suggest or comment?
POC created by Soulblack Group.
www.soulblack.com.ar
--
SoulBlack - Security Research
http://www.soulblack.com.ar
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | dBpowerAMP Auxiliary - Abnormal execution, SecuBox fRoGGz |
|---|---|
| Next by Date: | Re: index.cgi script XSS + file show, D.C. van Moolenbroek |
| Previous by Thread: | Possible XSS in User-Agent, Nicolas Montoza |
| Next by Thread: | Yager <= 5.24 Remote Buffer Overflow Exploit, cybertronic |
| Indexes: | [Date] [Thread] [Top] [All Lists] |