April 26, 2019

Cookie and five security-related properties


Cookie. 쿠키

서버가 제공하면 클라이언트(PC)에 저장하는 데이터.
The data that the server provides to the client (PC) to store.

The client sends the cookie to the server every time it connects to the server.
클라이언트는 서버 접속 시 매번 쿠키를 서버에 전송한다.

Because of the stateless environment of not storing state information, it is used to identify each individual at the server.

상태 정보를 저장하지 않는 stateless의 특성으로 인해, 서버에서 각 개인을 식별하기 위해 사용된다.

HostOnly

The property that causes cookies to be sent only to exactly the domain specified in the cookie.

쿠키에 지정된 도메인과 정확히 일치하는 곳으로만 쿠키가 전송되도록 하는 속성.

e.g.
.server.net → Cookies are sent when connecting to apple.server.net and also when connecting to banana.server.net.

.server.net → apple.server.net 접속 시에도, banana.server.net접속 시에도 쿠키 전송.

www.server.net → Cookies are sent only when connecting to www.server.net.

www.server.net → www.server.net 접속 시에만 쿠키 전송.

Session

The property that specifies whether this is a session cookie.

세션 쿠키인지 여부를 지정하는 속성.

It is deleted when the client (Web browser) is closed. The cookie has no expiration date.

클라이언트(웹 브라우저) 종료 시 삭제되며, 쿠키의 만료일이 없다는 특징이 있다.

Secure

The property that causes a cookie to be sent only when connecting to an encrypted(HTTPS) page.

암호화로 보호되는(HTTPS) 페이지에 접속하는 경우만 쿠키가 전송되도록 하는 속성.

It can prevent damage caused by eavesdropping that may occur in plaintext communication such as HTTP.

HTTP 같은 평문 통신에서 발생할 수 있는 도청으로 인한 피해를 예방할 수 있다.

HttpOnly

The property that disables cookie accessing to prevent access with JavaScript.

자바스크립트로 쿠키 열람이 불가하도록 하는 속성.

e.g. > document.cookie

It can prevent damage from XSS attacks that leak personal information through scripts.

스크립트를 통해 개인정보를 유출하는 XSS 공격으로 인한 피해를 예방할 수 있다.


SameSite

The property that prevents sending cookies when a cross-site connection(request) occurs from an external site.

외부 사이트로부터의(cross-site) 접속(요청) 발생 시 쿠키가 전송되지 않도록 하는 속성.

This can prevent damage due to CSRF attacks by limiting the functions from an external site.

외부에서의 기능 사용이 제한됨으로써 CSRF 공격으로 인한 피해를 예방할 수 있다.