Repository navigation
docs: correct cookie Secure and SameSite defaults and the cross-site guard - #178
Merged
Merged
Conversation
…guard Cookies default to Secure whatever NODE_ENV is, and to SameSite=Lax from @seamless-auth/express 0.27.0, fastify 0.18.0, nextjs 0.11.0 and the Go, Python and Rust adapters v0.7.0. The cross-site guard now runs whatever the SameSite setting and, without an allow-list, requires the Origin host to equal Host.
The Go page named v0.2.0 as the current release and install target, the server SDKs page said the Python, Go and Rust adapters were at 0.2.0, and the compatibility matrix listed 0.6.0 for all three. Each is at 0.7.0.
Both pages named 0.2.0 as the current release and in their compatibility tables. Each is at 0.7.0, which also changes the cross-site defaults.
Fourteen rows were behind their latest release. Versions and declared ranges are read from npm and the auth API v0.24.3 tag. The notes now cover OpenID Provider contract 4, the SameSite=Lax adapter default and syslog sinks in 0.24.0, and the scaffold table reflects seamless-cli 0.30.4 and templates v0.22.1.
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.
Closes #173
The cookie reference said
secureis true only underNODE_ENV=productionandsameSiteisnonein production andlaxelsewhere. Neither was true. This corrects it, and the other pages that stated the old defaults, against the released adapter code.Behavior documented
Checked against
seamless-auth-servermainand the published tags, andseamless-auth-go,seamless-auth-pythonandseamless-auth-rustatv0.7.0.secure:cookieSecure, defaulttrue, independent ofNODE_ENV(since@seamless-auth/express0.9.0).sameSite:cookieSameSite, defaultlax, independent ofcookieSecure. The v0.24 CSRF change (fix(csrf): require Origin to match Host without an allow-list and default to SameSite=Lax seamless-auth-server#283, commit193298a) shipped in@seamless-auth/coreand@seamless-auth/express0.27.0,@seamless-auth/fastify0.18.0 and@seamless-auth/nextjs0.11.0, all on npm. Earlier versions defaulted tononewhen secure. The pages name these versions.Laxfrom v0.7.0 (previouslyNone, orLaxwith insecure cookies).SameSitesetting. WithoutallowedOrigins, asame-siteor metadata-free request carrying anOriginmust have anOriginhost equal toHost.nullorigins and unknownSec-Fetch-Sitevalues are refused.Pages changed
reference/cookies-sessions-tokens.mdx: attribute table covers all three Node adapters, version note, and what a cross-site deployment sets (cookieSameSite: 'none',allowedOrigins).build/server-sdks.mdx: option defaults, and a newCross-site request guardsection replacing the paragraph that said the guard only ran forSameSite=Noneand allowed everything without an allow-list.build/nextjs.mdx: option defaults.build/go-adapter.mdx,build/python-adapter.mdx,build/rust-adapter.mdx:SameSiteand allowed-origins defaults and the guard paragraph.build/go-adapter.mdx: current release,go gettarget and compatibility table moved from v0.2.0 to v0.7.0, with the v0.7.0 cross-site upgrade note.build/python-adapter.mdx,build/rust-adapter.mdx: current release and compatibility table moved from 0.2.0 to 0.7.0, with the same upgrade note.build/server-sdks.mdxandbuild/ecosystem.mdx: the Python, Go and Rust adapters are listed at 0.7.0 (the matrix had 0.6.0, the SDKs page 0.2.0).build/ecosystem.mdxcompatibility matrix: every npm row and the auth API row brought to the v0.24.3 release (versions and declared ranges read from npm and the API tag). Notes updated for OpenID Provider contract 4 (oidc-provider0.5.x needs auth API 0.24.0 or later), theSameSite=Laxadapter default, and syslog sinks in 0.24.0. The scaffold table reflectsseamless-cli0.30.4 (templatesv0.22.1, auth API image still v0.23.0).npm run check:matrixreports all 18 rows matching.Release notes for v0.20 and v0.21 are left as they are: they describe those releases.
Checks
npm run lint,npm run typecheck(0 errors) andnpm run buildpass.