Repository navigation
Conversation
…token) as info, not an HttpOnly warning #1378 Signed-off-by: Nik Cubrilovic <[email protected]>
5 tasks done
…s say; case-sensitive names; glossary #1378 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.147 as nik |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1378 (the Lovable
__dplpart shipped in v0.0.146).Some frameworks send a CSRF token in a cookie that the frontend reads from script (Angular and Axios do);
HttpOnlyis needed only when the frontend does not read it.packages/rules/src/security/platform-cookies.ts, each with akind(platformorcsrf), docs links and the evidence. Every claim is cited from the framework docs, which I fetched: Angular (HttpClientreadsXSRF-TOKEN, setsX-XSRF-TOKEN), Laravel (theXSRF-TOKENcookie is sent so Angular and Axios can set the header), Spring Security (CookieCsrfTokenRepositorywritesXSRF-TOKEN;HttpOnlyfalse so JavaScript frameworks can read it) and Django (csrftokenis the default name;CSRF_COOKIE_HTTPONLYdefaults toFalseand Django says setting it offers no practical protection).cookie-httponly-csrfnaming the frameworks, the reason and the docs. Only the missing-HttpOnly warning is lifted: Secure, SameSite andSameSite=Noneare checked as before.session,sid,csrf_session,XSRF-TOKEN2,CSRFTOKENandxsrf-tokenstill warn.Tests (
packages/rules/tests/cookie-flags.test.ts, 5 new, plus the newline-joined test updated because it usedcsrftokenas its example of a warned cookie). Gates: rules tests (cookie-flags, private-target-skip), tsgo in packages/rules,make validate, released-changelog guard. Docs:docs/rules/security/cookie-flags.mdx. CHANGELOG under Unreleased / Fixed. Skill: no change needed.nik
Review round: wording now claims only what the sources say (Django supports HttpOnly on its cookie and calls it no practical protection; Spring recommends HttpOnly when JavaScript does not need the cookie; Laravel calls the cookie a convenience for Angular and Axios), corpus counts dropped from the public text, names stated case-sensitive, message without a trailing paren, tests for prefixed names and a CSRF-only page, glossary page updated.