ConcatKDF::generate(), the key derivation function behind the ECDH-ES and ECDH-SS key agreement algorithms, computes a single SHA-256 round and truncates it to the requested length. It never returns more than 32 bytes. The Concat KDF that RFC 7518 (section 4.6.2) takes from NIST SP 800-56A concatenates as many rounds as needed to reach the requested key length.
In direct key agreement mode ("alg": "ECDH-ES"), the derived key is the content encryption key (CEK). The AES-CBC-HMAC-SHA2 algorithms split it into MAC_KEY followed by ENC_KEY (RFC 7518, section 5.2.2.1). With a 32-byte CEK:
JWE produced with alg set to ECDH-ES and enc set to A256CBC-HS512 (content readable by anyone) or A192CBC-HS384 (64-bit content key), whatever the curve. This was measured with P-256, P-521 and X25519. The non-registered ECDH-SS algorithm shares the same derivation.
Not affected: A128CBC-HS256, A128GCM, A192GCM, A256GCM, and the key wrapping variants ECDH-ES+A128KW, ECDH-ES+A192KW and ECDH-ES+A256KW. They all request 256 bits or less, which a single round covers.
The defect has been present since the first release of the library.
ConcatKDF::generate() now concatenates as many SHA-256 rounds as the requested length needs. JWEBuilder and JWEDecrypter now check the length of a key obtained by key agreement, as they already did for wrapped and encrypted keys.
Compatibility. The fix changes the key derived for ECDH-ES with A192CBC-HS384 and A256CBC-HS512:
Until you upgrade, encrypt with ECDH-ES and A128CBC-HS256 or A128GCM/A192GCM/A256GCM, or use ECDH-ES+A128KW/ECDH-ES+A192KW/ECDH-ES+A256KW. Consider the content of every token already produced with ECDH-ES and A256CBC-HS512 as disclosed, and the content of the tokens produced with ECDH-ES and A192CBC-HS384 as weakly protected.
Reported by Jeroen Robben.
소스: NVD
무료 취약점 평가
9개 보안 영역에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 파악하세요.
맞춤형 데모를 받아보세요
"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."