Skip to content

JS: add a js/samesite-none-cookie cookie #7721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 25, 2022
Merged

Conversation

erik-krogh
Copy link
Contributor

@erik-krogh erik-krogh commented Jan 24, 2022

MDN Web Docs: SameSite.

I've set the @precision to medium, because SameSite=None is only an issue if there isn't any other CSRF protection.
And the query makes no attempt to detect the existence of CSRF protection.

The default value for SameSite is Lax.
The Lax setting is not great, but also not terrible, so I don't want to flag that.
(Also: The SameSite attribute is somewhat recent. E.g. there is no IE version that supports it).

Evaluation shows no new results, and a constant slow-down caused by having to compile the new query.
/cc @esbena: This is at least the second time I've seen an evaluation where a new query is compiled by codeql-action/analyze because it didn't hit anything in the cache.

@erik-krogh erik-krogh added the Awaiting evaluation Do not merge yet, this PR is waiting for an evaluation to finish label Jan 24, 2022
@erik-krogh erik-krogh force-pushed the CWE-1275 branch 3 times, most recently from bfe2ac0 to f52d32a Compare January 24, 2022 20:39
@erik-krogh erik-krogh removed the Awaiting evaluation Do not merge yet, this PR is waiting for an evaluation to finish label Jan 24, 2022
@erik-krogh erik-krogh marked this pull request as ready for review January 24, 2022 20:41
@erik-krogh erik-krogh requested a review from a team as a code owner January 24, 2022 20:41
Copy link
Contributor

@esbena esbena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with one suggestino for some code sharing.

@@ -132,6 +148,10 @@ private module JsCookie {
}

override predicate isSensitive() { canHaveSensitiveCookie(this.getArgument(0)) }

override string getSameSite() {
this.getOptionArgument(2, "sameSite").mayHaveStringValue(result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we introduce a shared (inline) predicate for this string/bool -> string conversion? I list the suggestion here because I do not see the harm in adding it for this smaller predicate as well.

@esbena esbena added the ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. label Jan 25, 2022
@mchammer01 mchammer01 self-requested a review January 25, 2022 09:17
mchammer01
mchammer01 previously approved these changes Jan 25, 2022
Copy link
Contributor

@mchammer01 mchammer01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erik-krogh - LGTM from an editorial point of view ✨
Made a few minor suggestions.

Copy link
Contributor

@mchammer01 mchammer01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comments 💖

@erik-krogh erik-krogh merged commit cc527bd into github:main Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation JS ready-for-doc-review This PR requires and is ready for review from the GitHub docs team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants