Skip to content

Commit

Permalink
fix(core): Use more secure default for cookie sameSite option
Browse files Browse the repository at this point in the history
Relates to GHSA-h9wq-xcqx-mqxm.
The default used by the underlying `cookie-session` middleware is `false`, which is the least
secure setting. In modern browsers, this should be interpreted as `lax`, but this cannot be assumed
to be the case in 100% of situations. Therefore, we will now default to `lax` and if the user
needs a less restrictive policy, they can explicitly set it to `none`.
  • Loading branch information
michaelbromley committed Jul 3, 2023
1 parent fba0739 commit 4a10d67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/config/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const defaultConfig: RuntimeVendureConfig = {
cookieOptions: {
secret: Math.random().toString(36).substr(3),
httpOnly: true,
sameSite: 'lax',
},
authTokenHeaderKey: DEFAULT_AUTH_TOKEN_HEADER_KEY,
sessionDuration: '1y',
Expand Down

0 comments on commit 4a10d67

Please sign in to comment.