🔍 CVE-2022-36083

5.3
CVSS Score
MEDIUM
2022-09-07
2026-06-22 03:10
✅ 완료

🇰🇷 한글 설명

JOSE 라이브러리의 PBKDF2 기반 JWE 키 관리 알고리즘에서 발생하는 취약점으로, 공격자가 'p2c' 헤더 파라미터에 매우 높은 반복 횟수를 설정하여 CPU 자원을 과도하게 소모하게 만들 수 있습니다. 이로 인해 서비스 거부(DoS) 상태가 발생할 수 있으며, 신뢰할 수 없는 소스의 JWE를 처리할 때 위험합니다.

💡 쉬운 설명

악의적인 사용자가 계산량이 엄청나게 많은 암호화 요청을 보내 컴퓨터의 CPU를 마비시키는 공격입니다. 마치 아주 어려운 수학 문제를 수조 번 풀게 만들어 컴퓨터를 멈추게 하는 것과 같습니다.

🇺🇸 원문 (English)

JOSE is "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno. The PBKDF2-based JWE key management algorithms expect a JOSE Header Parameter named `p2c` PBES2 Count, which determines how many PBKDF2 iterations must be executed in order to derive a CEK wrapping key. The purpose of this parameter is to intentionally slow down the key derivation function in order to make password brute-force and dictionary attacks more expensive. This makes the PBES2 algorithms unsuitable for situations where the JWE is coming from an untrusted source: an adversary can intentionally pick an extremely high PBES2 Count value, that will initiate a CPU-bound computation that may take an unreasonable amount of time to finish. Under certain conditions, it is possible to have the user's environment consume unreasonable amount of CPU time. The impact is limited only to users utilizing the JWE decryption APIs with symmetric secrets to decrypt JWEs from untrusted parties who do not limit the accepted JWE Key Management Algorithms (`alg` Header Parameter) using the `keyManagementAlgorithms` (or `algorithms` in v1.x) decryption option or through other means. The `v1.28.2`, `v2.0.6`, `v3.20.4`, and `v4.9.2` releases limit the maximum PBKDF2 iteration count to `10000` by default. It is possible to adjust this limit with a newly introduced `maxPBES2Count` decryption option. If users are unable to upgrade their required library version, they have two options depending on whether they expect to receive JWEs using any of the three PBKDF2-based JWE key management algorithms. They can use the `keyManagementAlgorithms` decryption option to disable accepting PBKDF2 altogether, or they can inspect the JOSE Header prior to using the decryption API and limit the PBKDF2 iteration count (`p2c` Header Parameter).

📍 영향받는 시스템

JOSE (v1.x < 1.28.2, v2.x < 2.0.6, v3.x < 3.20.4, v4.x < 4.9.2)

⚔️ 공격 벡터

신뢰할 수 없는 소스로부터 매우 높은 PBKDF2 반복 횟수(p2c)를 포함한 JWE를 전송하여 CPU 자원 고갈 유도

🛡️ 대응 방법

라이브러리를 최신 버전으로 업데이트하거나, decryption 옵션에서 PBKDF2 알고리즘을 비활성화 또는 p2c 값을 제한함

🔧 검증 코드

명령어 결과에 현재 설치된 jose 버전이 취약한 범위에 포함되는지 확인합니다.

Shell / Script
npm list jose | grep -E 'jose@(1\.(2[8-9]|3[0-9]|[4-9][0-9])\\.|2\\.(0\\.[6-9]|[1-9][0-9])|3\\.(20\\.[0-4])|4\\.[0-9]\\.[0-4])'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

💻 영향받는 소프트웨어

Node.js