nodeSolidServer / nodeSolidServer/node-solid-server

Cookie not set with SameSite attribute

未關閉
#1,463 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
1.8k
分支
308
PR 合併指標
30 天內沒有已合併 PR

描述

As noted on solid-auth-client https://github.com/solid/solid-auth-client/issues/151, Chrome is requiring third party cookies to be set with SameSite=None and Secure. While this setting is not yet active on desktop, it is active on Android and therefore breaks all Solid apps using the nssidp.sid cookie from .solid.community.
This can still be bypassed by disabling chrome://flags/#same-site-by-default-cookies.
Presumably non-cookie based authentication doesn't have this issue but I'm not sure it's possible to turn off cookie-based authentication at the moment (https://github.com/solid/node-solid-server/issues/672)

I'm not an expert, but it appears the change required is in the definition of the express-session settings
https://github.com/solid/node-solid-server/blob/master/lib/create-app.js#L305
https://www.npmjs.com/package/express-session#cookiesamesite

It may be sufficient to simply use:

    cookie: {
      maxAge: 24 * 60 * 60 * 1000,
      sameSite:'None'
    }

It seems that http connections should also be completely dropped for authenticated sessions because the third party cookie won't be sent without cookie.secure=true anyway.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 lib/create-app.js 中大約第 305 行開始,搭配 express-session 文件檢查 express-session 的 Cookie 設定。在啟用 SameSite Cookie 強制執行的情況下,於 Android Chrome 中重現 nssidp.sid 的行為,接著驗證已驗證的 Solid 應用程式能夠建立並使用工作階段,同時不會破壞支援的連線模式。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
express, javascript
領域
authentication, backend
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。