Skip to content

Commit 4a10d67

Browse files
fix(core): Use more secure default for cookie sameSite option
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`.
1 parent fba0739 commit 4a10d67

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/core/src/config/default-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const defaultConfig: RuntimeVendureConfig = {
8686
cookieOptions: {
8787
secret: Math.random().toString(36).substr(3),
8888
httpOnly: true,
89+
sameSite: 'lax',
8990
},
9091
authTokenHeaderKey: DEFAULT_AUTH_TOKEN_HEADER_KEY,
9192
sessionDuration: '1y',

0 commit comments

Comments
 (0)