To comply with the rule, in this write up, some hints related to this challenge only will be mentioned.
룰을 준수하기 위해, 여기서는 챌린지와과 관련된 몇 가지 힌트만이 언급됩니다.
JWT signing
Each JWT token should at least be signed before sending it to a client, if a token is not signed the client application would be able to change the contents of the token. The signing specifications are defined here(https://tools.ietf.org/html/rfc7515) the specific algorithms you can use are described here(https://tools. ietf.org/html/rfc7518) It basically comes down you use "HMAC with SHA-2 Functions" or "Digital Signature with RSASSA-PKCS1-v1_5 / ECDSA / RSASSA-PSS" function for signing the token.
JWT 서명.
각 JWT는 클라이언트에게 전송되기 전 서명되어야 한다. 서명되지 않는다면 클라이언트 측에서 JWT의 위조가 가능하다. 서명에 대한 스펙(설명)은 여기(https://tools.ietf.org/html/rfc7515)에서 확인 가능하고, 사용되는 알고리즘에 대한 내용은 여기(https://tools.ietf.org/html/rfc7518)에서 확인 가능하다. 알고리즘은 기본적으로 "SHA-2"와 함께 "HAMC"을 사용하거나, "RSASSA-PKCS1-v1_5", "ECDSA", "RSASSA-PSS"가 사용된다.
Checking the signature
One important step is to verify the signature before performing any other action, let’s try to see some things you need to be aware of before validating the token.
서명 확인.
중요한 과정 중 하나는, 타 작업 수행 전, 서명을 검증하는 것이다. (아래의 챌린지를 통해서) 토큰을 검증하기 전에 주의해야 할 사항을 살펴보도록 한다.
Assignment
Try to change the token you receive and become an admin user by changing the token and once you are admin reset the votes
도전.
서버로부터 할당받은 토큰을 변조하여 "admin" 사용자로 둔갑한 뒤 투표 현황을 초기화(reset)하라.
Each JWT token should at least be signed before sending it to a client, if a token is not signed the client application would be able to change the contents of the token. The signing specifications are defined here(https://tools.ietf.org/html/rfc7515) the specific algorithms you can use are described here(https://tools. ietf.org/html/rfc7518) It basically comes down you use "HMAC with SHA-2 Functions" or "Digital Signature with RSASSA-PKCS1-v1_5 / ECDSA / RSASSA-PSS" function for signing the token.
JWT 서명.
각 JWT는 클라이언트에게 전송되기 전 서명되어야 한다. 서명되지 않는다면 클라이언트 측에서 JWT의 위조가 가능하다. 서명에 대한 스펙(설명)은 여기(https://tools.ietf.org/html/rfc7515)에서 확인 가능하고, 사용되는 알고리즘에 대한 내용은 여기(https://tools.ietf.org/html/rfc7518)에서 확인 가능하다. 알고리즘은 기본적으로 "SHA-2"와 함께 "HAMC"을 사용하거나, "RSASSA-PKCS1-v1_5", "ECDSA", "RSASSA-PSS"가 사용된다.
Checking the signature
One important step is to verify the signature before performing any other action, let’s try to see some things you need to be aware of before validating the token.
서명 확인.
중요한 과정 중 하나는, 타 작업 수행 전, 서명을 검증하는 것이다. (아래의 챌린지를 통해서) 토큰을 검증하기 전에 주의해야 할 사항을 살펴보도록 한다.
Assignment
Try to change the token you receive and become an admin user by changing the token and once you are admin reset the votes
도전.
서버로부터 할당받은 토큰을 변조하여 "admin" 사용자로 둔갑한 뒤 투표 현황을 초기화(reset)하라.
지문에서 언급되었던 알고리즘 스펙을 확인해보면, "HS512"는 "SHA-512"를 사용한 "HMAC"이라고 나온다. 그런데 이는 어찌되었든 암호화 방식이며, 우리는 암호 키를 알지 못하기 때문에 지금 당장 시그니처를 조작하기는 어렵다.
But at the bottom of it, It says that it is also possible setting the algorithm to "none", and states that it does not use digital signatures. It is also meaningful to look at the server's response when sending a JWT without a signature.
그런데 맨 아래 부분을 보면, 알고리즘을 "none"으로 설정할 수도 있다는 내용도 있는데, 이는 디지털 서명을 수행하지 않는 방식이라고 명시되어 있다. 서명 없이 JWT를 전송할 때 서버의 반응을 살피는 것도 충분히 의미 있다고 생각된다.