취약점 데이터베이스GHSA-5pj7-wx9m-cjh6

GHSA-5pj7-wx9m-cjh6: 
PHP 취약점 분석 및 완화

Impact

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:

  • A256CBC-HS512 expects 64 bytes. The 32 bytes all become MAC_KEY and ENC_KEY is empty. PHP's OpenSSL extension pads a short key with zero bytes, so the content is encrypted under an all-zero AES-256 key. Anyone who obtains the token can decrypt it, without the recipient's private key.
  • A192CBC-HS384 expects 48 bytes. ENC_KEY is made of 8 secret bytes followed by 16 zero bytes: the content key has 64 bits of strength instead of 192. MAC_KEY stays secret, so integrity is not affected. The loss is the confidentiality of the tokens the library produces. Neither the builder nor the decrypter checked the length of a key obtained by key agreement, and both derived the same short key, so round trips within the library succeeded. Conforming implementations cannot decrypt the tokens produced this way, and the library cannot decrypt the tokens they produce with these two algorithms.

Affected configurations

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.

Patches

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:

  • tokens produced with these combinations before the upgrade cannot be decrypted after it, and have to be issued again;
  • a patched party and an unpatched one cannot exchange such tokens, so producers and consumers have to be upgraded together;
  • tokens produced by other conforming implementations can now be decrypted.

Workarounds

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.

References

  • RFC 7518, section 4.6.2 (Key Derivation for ECDH Key Agreement), sections 5.2.2.1 and 5.2.5
  • NIST SP 800-56A, section 5.8.1 (Concatenation Key Derivation Function)

Credits

Reported by Jeroen Robben.


소스: NVD

관련 PHP 취약점:

CVE ID

심각도

점수

기술

구성 요소 이름

CISA KEV 악용

수정 사항이 있습니다

출판일

GHSA-5pj7-wx9m-cjh6HIGH8.2
  • PHP logoPHP
  • web-token/jwt-framework
아니요네Oct 31, 2026
CVE-2026-96633HIGH8.1
  • PHP logoPHP
  • adminneo-org/adminneo
아니요네Oct 30, 2026
GHSA-j265-mg9q-wpv9HIGH7.1
  • PHP logoPHP
  • web-token/jwt-framework
아니요네Oct 31, 2026
CVE-2026-96634MEDIUM6.9
  • PHP logoPHP
  • adminneo-org/adminneo
아니요네Oct 30, 2026
GHSA-rqmg-p367-f63rMEDIUM4.3
  • PHP logoPHP
  • power-components/turbine
아니요네Oct 31, 2026

무료 취약점 평가

클라우드 보안 포세를 벤치마킹하세요

9개 보안 영역에서 클라우드 보안 관행을 평가하여 위험 수준을 벤치마킹하고 방어의 허점을 파악하세요.

요청 평가

추가 Wiz 리소스

맞춤형 데모를 받아보세요

맞춤형 데모 신청하기

"내가 본 최고의 사용자 경험은 클라우드 워크로드에 대한 완전한 가시성을 제공합니다."
데이비드 에슬릭CISO
"Wiz는 클라우드 환경에서 무슨 일이 일어나고 있는지 볼 수 있는 단일 창을 제공합니다."
아담 플레처최고 보안 책임자(CSO)
"우리는 Wiz가 무언가를 중요한 것으로 식별하면 실제로 중요하다는 것을 알고 있습니다."
그렉 포니아토프스키위협 및 취약성 관리 책임자