본문 바로가기

장애&오류&예외/개발

[ Browser-Issue ] Chrome Release 80 버전 쿠키정책 변경에 따른 PG(Payment Gateway, 결제대행)사 시스템 연동 이슈발생 소지 및 조치 방안

Google사, 브라우저 Chrome의 쿠키정책 변경에 따른 이슈사항에 대해 기재한다.

대상 정책이 적용되는 버전은 release 80 부터이며, 적용 내용은 간략하게 아래와 같다.

#- Cookie header 설정 기본값 변동

- SameSite None으로 설정할 경우, 모든 도메인에서 쿠키를 전송하도록 사용할 수 있기 때문에  
  사용자가 사이트간에 요청위조(CSRF- Cross Site Request Forgery)및 의도하지 않은 정보유출에 노출될 수 있어 
  취약점 조치를 위해 Default설정인 SameSite=None에서 SameSite=Lax로 변경토록 수정되었다. 
- 이후 Firefox, Edge 등 여러 브라우저에서도 패치예정

#- 상세한 옵션정보나, 헤더값에 대해서는 하단의 References를 참조.

이와 같이 예상치 못한 브라우저의 패치로 인해 AP영역에 영향을 받게 되어 작업을 하게되었다.

영향을 받게된 대상은 결제모듈(PG)이/가 메인이라 볼 수 있을 것이다.(아이핀/본인인증/etc)

Cookie의 헤더값에 대한 조정이기에 소스상으로 또는 각 영역별(WAS/WEB)에서도 설정이 가능하지만,

저자는 소스상으로 적용 시, 개발기간 공수산정 기간확보가 부족하여 WEB에 적용하는 방침으로 하였다.

설정 내용은 다소 간소하며, 하단을 참고하겠다.

 

#- 해당 이슈로 인해 확인되는 현상

- 결제 시도 시, 세션을 유지하지 못하고 끊김과 동시에 타 WAS서버로 세션 재생성.

 

# For apache2 >= 2.2.4

Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure;SameSite=None;

 

# For apache2 lower than 2.2.4

Header set Set-Cookie HttpOnly;Secure;SameSite=None

 

동일한 사이트로 Cookie값을 전달하여야 하나, 차단되어 기능 비활성화에 따른 쿠키 설정조치.

 

브라우저상으로 설정적용여부 확인 (비설정시, 체크마크 확인불가)

 

#- References

[chrome] release schedule

[chrome] chrome release version 80 cookie-samesite-option policy changed

[chrome] Cookies default to "SameSite=Lax"

[chrome] Reject insecure "SameSite=None" cookies

[chrome] same-site incompatible-clients

[chrome] same-site released detail info

[mozilla] Set-Cookie Browser compatibility

[KG inicis] inicis notice

[web dev] samesite-cookies-explained

[javascript] javascript-samesite-option

[github] Allow configuration of session cookie SameSite attribute as an application property

[Nginx-AirisX] nginx_cookie_flag_module

[serverfault] add-samesite-to-cookies-using-nginx-as-reverse-proxy

[Nginx] ngx_http_proxy_module proxy_cookie_path

[stackoverflow] how-to-set-samesite-cookie-attribute-using-apache-configuration

[apache-docs] mod_headers