github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.54k stars 1.5k forks source link

Incomplete documentation for cs/web/broad-cookie-domain #15169

Open johnaceous opened 9 months ago

johnaceous commented 9 months ago

I believe the CodeQL documentation here conflicts with MDN by omission:

In this example cookie1 is accessible from online-bank.com ...

        HttpCookie cookie1 = new HttpCookie("sessionID");
        cookie1.Domain = "online-bank.com";

https://codeql.github.com/codeql-query-help/csharp/cs-web-broad-cookie-domain/

According to MDN, that cookie would also be available to subdomains:

For example, if you set Domain=mozilla.org, cookies are available on mozilla.org and its subdomains like developer.mozilla.org.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#domain_attribute

The CodeQL documentation should state that "In this example cookie1 is accessible from online-bank.com and its subdomains".

aeisenberg commented 9 months ago

Thanks for mentioning this. I'll take a look.