Chapter 6: AJAX Types, Discovery, and Parameter Manipulation 173
Cookie Flags
In additional to the session ID component of cookies, several other factors can contribute
significantly (or detract significantly) from a cookie??™s security. These components include
the Secure and HTTPOnly flags, the Domain and Path properties, and any extra sitespecific
items.
Secure Flag
The Secure flag restricts the browser from sending the cookie in the clear over HTTP.
Instead, the cookie will be transmitted only when the communication is over HTTPS.
This flag is supported by all major browsers and will prevent an attacker from being able
to obtain the cookie by sniffing the network.
HTTPOnly Flag
The HTTPOnly flag is used to prevent attacks from stealing cookies via cross-site scripting
(XSS). The flag achieves this by disabling script in the browser from accessing
any cookies. This flag is currently understood only in Microsoft Internet Explorer and
Mozilla Firefox.
174 Hacking Exposed Web 2.0
Domain Property
The Domain property of a cookie is used to limit the scope of servers allowed to access
the cookie. If an application sets its domain property only to the web server on which it
is running, for example, www.
Pages:
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316