GooJinSun / diivers

https://diivers.world
5 stars 0 forks source link

[개선] 인증용 토큰을 http-only cookie로 설정하기 #216

Open GooJinSun opened 1 year ago

GooJinSun commented 1 year ago

(급한 이슈는 아니지만 기록차 남깁니다)

현재 JWT 토큰을 저장하는 방식은XSS 보안에 취약할 수 있음 js로 탈취할 수 있는 가능성을 막기 위해 httponly cookie 세팅을 하면 좋음

A cookie with the HttpOnly attribute is inaccessible to the JavaScript Document.cookie API; it's only sent to the server. For example, cookies that persist in server-side sessions don't need to be available to JavaScript and should have the HttpOnly attribute. This precaution helps mitigate cross-site scripting (XSS) attacks.-MDN