pf » Firefox Now Supports HttpOnly Cookies
Firefox Now Supports HttpOnly Cookies
You may be surprised to learn that Microsoft Internet Explorer has supported a a security feature called HttpOnly cookies since IE 6 SP1. Firefox 2.0.0.5, which was released just the other day, now supports it.
When a cookie is HttpOnly the web browser should (see note about firefox implementation below) not allow client side scripts such as JavaScript to have access to the cookie. This can help mitigate the effects of cross site scripting (XSS) attacks.
To set a HttpOnly cookie with ColdFusion you need to use cfheader since cfcookie doesn't yet support HttpOnly.
<cfheader name="Set-Cookie" value="safe=maybe;HttpOnly">
It would be nice if the cfcookie tag simply had an attribute HttpOnly=true/false. Go make a wish. While you are at it it would also be nice to have a setting to make the CFID, CFTOKEN and jsessionid cookies httpOnly, or secure cookies.
Here's a MSDN doc with some additional info about HttpOnly.
Firefox's implementation of HttpOnly however still leaves open a big hole, as RSnake points out, you can do an XMLHttpRequest to get the cookie values from the HTTP response headers. When I test in IE 6 (RSnake's example doesn't work in IE), I don't have access to the Set-Cookie from the AJAX HTTP response header. +1 for MSIE.
add to del.icio.us
| Tags: security, cookies, httponly, firefox, ie, microsoft, ajax
Related Entries
- AJAX on IE - back to the IFRAME - August 17, 2005
- Top 20 Internet Security Vulnerabilities of 2005 - November 23, 2005
- The Proper Content Type for XML Feeds - June 13, 2005
- Web Standards Browser Test - April 14, 2005
- Objection - Firefox Extension for removing Local Shared Objects - April 11, 2005
Did you mean to say:
"When a cookie is HttpOnly the web browser should *not* allow client side scripts such as JavaScript to have access to the cookie."
???
Yes that is what it should say, thanks, fixed.
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
RSS
Pete Freitag is a software engineer, and web developer located in










