Media

PHP JWT Framework: Chacha20Poly1305 key-encryption algorithm discards the Poly1305 authentication tag, performing no authentication on decryption

  • Publicada: 18.06.2026
  • Actualizado: 11.10.2026 10:22

Impact

The experimental Chacha20Poly1305 key-encryption algorithm generates the 16-byte Poly1305 authentication tag during encryptKey() but discards it: the tag is never written to the header and therefore never reaches the wire. On the receiving side, decryptKey() calls openssl_decrypt('chacha20-poly1305', ...) without the tag argument, which makes OpenSSL skip authentication entirely.

As a result the AEAD construction is silently degraded to unauthenticated ChaCha20: a tampered encrypted CEK is accepted, and because ChaCha20 is a stream cipher, a single-byte change in the ciphertext propagates as a single-byte change in the recovered CEK with no integrity check (CWE-353 / CWE-347). An attacker on the token path can manipulate the wrapped key without detection.

Affected configurations

Applications that register Jose\Experimental\KeyEncryption\Chacha20Poly1305 (package web-token/jwt-experimental) as a JWE alg.

Patches

encryptKey() now publishes the Poly1305 tag as the base64url tag header parameter (and asserts it is 16 bytes). decryptKey() requires the tag header, validates its length, and passes it to openssl_decrypt() so the tag is actually verified, in line with RFC 7539 / RFC 8439. Tampering now results in a decryption failure.

Note: this changes the wire format of tokens produced with this experimental algorithm (a tag header is now emitted and required).

Workarounds

Do not use the experimental Chacha20Poly1305 key-encryption algorithm for untrusted input until upgraded.

References

  • RFC 7539 / RFC 8439 (ChaCha20-Poly1305 AEAD)
  • CWE-353: Missing Support for Integrity Check

Résolution

Un correctif a été préparé sur une branche dédiée basée sur 3.4.x, avec des tests anti-régression dédiés (fork privé temporaire de cette advisory, PR #1).

ChaCha20-Poly1305 — le tag d'authentification Poly1305 est désormais publié dans le header au chiffrement et vérifié au déchiffrement (RFC 7539), rétablissant l'intégrité AEAD.

Validation : php -l OK, PHPUnit vert, aucune nouvelle erreur PHPStan introduite (différentiel nul vs 3.4.x), aucun commentaire ajouté dans le code source. Après merge, cascade prévue 3.4.x → 4.0.x → 4.1.x.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de Composer web-token/jwt-experimental <= 4.1.6 sin corrección
Paquete de Composer web-token/jwt-library < 3.4.10, >= 4.0.0, < 4.0.7, >= 4.1.0, < 4.1.7 3.4.10, 4.0.7, 4.1.7

Referencias

Puntuación CVSS -
Vector CVSS
CVSS:4.0/AV:A/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Debilidad (CWE)
CWE-347, CWE-353
Plataforma
Composer
Paquete
web-token/jwt-experimental, web-token/jwt-library
Publicada
18.06.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-6vvh-pxr4-25r7 - CC BY 4.0

Historial de vulnerabilidades: web-token/jwt-library

Todas las vulnerabilidades publicadas de este paquete (Paquete de Composer), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
4
Primera → última
06.2026 06.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 2
  • Media 2

Divulgaciones por año

  1. 2026: 4
  1. Media ghsa-5739-39v2-5754 < 3.4.10, >= 4.0.0, < 4.0.7, >= 4.1.0, < 4.1.7 3.4.10, 4.0.7, 4.1.7
  2. Alta ghsa-jc38-x7x8-2xc8 < 3.4.10, >= 4.0.0, < 4.0.7, >= 4.1.0, < 4.1.7 3.4.10, 4.0.7, 4.1.7
  3. Alta ghsa-3prj-6hqw-cm82 < 3.4.10, >= 4.0.0, < 4.0.7, >= 4.1.0, < 4.1.7 3.4.10, 4.0.7, 4.1.7
  4. PHP JWT Framework: Chacha20Poly1305 key-encryption algorithm discards the Poly1305 authentication tag, performing no authentication on decryption esta entrada
    Media ghsa-6vvh-pxr4-25r7 < 3.4.10, >= 4.0.0, < 4.0.7, >= 4.1.0, < 4.1.7 3.4.10, 4.0.7, 4.1.7

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.