ABSTRACT

A cookie with an overly broad domain opens an application to attacks through other applications.

EXPLANATION

Developers often set cookies to be active across a base domain like ".example.com". This exposes the cookie to all web applications on the base domain and any sub-domains. Since cookies often carry sensitive information such as session identifiers, sharing cookies across applications can lead a vulnerability in one application to cause a compromise in another.

Example:
Imagine you have a secure application deployed at http://secure.example.com/, and the application sets a session ID cookie with domain ".example.com" when a user logs in.

For example:


HttpCookie cookie = new HttpCookie("sessionID", sessionID);
cookie.Domain = ".example.com";


Suppose you have another, less secure, application at http://insecure.example.com/ and it contains a Cross-Site Scripting vulnerability. Any user authenticated to http://secure.example.com that browses to http://insecure.example.com risks exposing their session cookie from http://secure.example.com.

In addition to reading a cookie, it might be possible for attackers to perform a Cookie Poisoning attack by using insecure.example.com to create its own overly broad cookie that overwrites the cookie from secure.example.com.

REFERENCES

[1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management

[2] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A6 Information Leakage and Improper Error Handling

[3] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A6 Security Misconfiguration

[4] Standards Mapping - FIPS200 - (FISMA) CM

[5] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Information Leakage

[6] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.10

[7] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.7

[8] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.8