-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
bfe2ac0
to
f52d32a
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Co-authored-by: mc <[email protected]>
There was a problem hiding this 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 💖
MDN Web Docs: SameSite.
I've set the
@precision
tomedium
, becauseSameSite=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
isLax
.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.