Skip to content

[dtq-dev-9-base][v7→v9 adapted] fix(security): harden dsAuthInfo auth cookie with Secure and SameSite (port of #1663) - #1678

Open
Kasinhou wants to merge 1 commit into
dtq-dev-9-basefrom
v9base/port-1663
Open

Kasinhou wants to merge 1 commit into
dtq-dev-9-basefrom
v9base/port-1663

Conversation

@Kasinhou

Copy link
Copy Markdown

⚠️ PORT z v7 — CHERRY-PICK NEBOL ČISTÝ, MUSEL BYŤ UPRAVENÝ PRE v9

Tento fix pochádza z dtq-dev (v7). Cherry-pick do dtq-dev-9-base sa NEDAL aplikovať úplne čisto a bolo ho treba manuálne prispôsobiť v9. Prosím o dôkladný review.

Čo bolo treba upraviť: líšil sa len názov typu cookie options (v9 používa Cookies.CookieAttributes, v7 CookieAttributes) — ponechaný v9 typ s v7 poliami secure/sameSite. ⚠️ spec NEBOL portnutý (v9 má inú štruktúru importov). POZN.: v9 má druhý zápis cookie (storeImpersonatingTokenAsCookie/druhý výskyt ~r.592), ktorý v7 fix nemenil — zvážiť zahardenovať tiež.


Port of #1663 z dtq-dev do dtq-dev-9-base. Part of UFAL/Propagate PRs to v9: dataquest-dev/dspace-customers#1107

🤖 Generated with Claude Code

…#1663)

* Harden dsAuthInfo auth cookie with Secure and SameSite attributes

Set secure and sameSite='lax' on the auth JWT cookie written in storeToken(),
as defense-in-depth. The Secure flag is derived from the actual page protocol
(location.protocol === 'https:') so it is applied on any https page, including
behind a TLS-terminating reverse proxy, while local http dev still works.
'lax' is used rather than 'strict' so the cookie is still sent on the top-level
navigation that returns from external authentication.

* docs: shorten auth cookie security comment

---------

Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk>
(cherry picked from commit 9bcd483)
@Kasinhou Kasinhou self-assigned this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant