You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
“CSRF는 사용자가 이미 로그인한 상태에서, 공격자가 몰래 조작한 요청을 자동으로 보내 세션 권한을 탈취하거나 상태를 변경하도록 만드는 공격 기법입니다. Spring Security는 ‘동기화 토큰 패턴’을 기반으로 세션(HttpSession)에 CSRF 토큰을 저장하고, 모든 상태 변경 요청에 대해 클라이언트가 보낸 토큰과 세션 토큰을 비교 검증하는 CsrfFilter를 제공함으로써 이를 방어합니다.”
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
자세한 설명~
CSRF(Cross-Site Request Forgery)
<img>태그나 자동 전송되는 폼이 A은행의계좌이체엔드포인트로 요청을 보내 세션 쿠키와 함께 실행Spring Security의 CSRF 방어 메커니즘
HttpSession)에 저장합니다.<input type="hidden" name="_csrf" value="${_csrf.token}"/>형태로 폼에 토큰을 포함시키고, AJAX 요청 시에는 HTTP 헤더(X-CSRF-TOKEN)에 담아 보냅니다.CsrfFilter403 Forbidden응답을 반환하여 요청을 차단합니다.HttpSessionCsrfTokenRepository를 사용하지만, SPA나 REST API 환경에서는CookieCsrfTokenRepository를 활용해 쿠키 기반으로 토큰을 전달하기도 합니다.간단 답변
Beta Was this translation helpful? Give feedback.
All reactions