PHP JWT Framework missing integrity check in Chacha20Poly1305

Severity: medium · CVSS 6 · Published 2026-06-18

A vulnerability exists in the experimental ChaCha20Poly1305 encryption algorithm within the PHP JWT Framework. This library is used to secure web tokens, but a flaw in this specific algorithm fails to verify the integrity of encrypted data. An attacker could potentially tamper with encrypted tokens without being detected, leading to the use of manipulated security keys.

Technologies: Web-Token JWT Library. Vendors: Web-Token.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 6, published 18 June 2026.
Which products and versions are affected?
Web-Token JWT Library < 3.4.10, >= 4.0.0 < 4.0.7, >= 4.1.0 < 4.1.7; Web-Token Jwt-Experimental <= 4.1.6.
Is there a fix for This vulnerability?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run Web-Token JWT Library or Web-Token Jwt-Experimental at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The experimental Chacha20Poly1305 key-encryption algorithm in web-token/jwt-framework generates a 16-byte Poly1305 authentication tag during encryption but fails to write it to the JWE header. Consequently, the decryption function calls openssl_decrypt without the required tag argument, causing OpenSSL to skip authentication entirely. This degrades the AEAD construction to unauthenticated ChaCha20. Because ChaCha20 is a stream cipher, an attacker can manipulate the ciphertext to predictably alter the recovered Content Encryption Key (CEK) without triggering an integrity error. Patches have been released in versions 3.4.10, 4.0.7, and 4.1.7 to properly handle the authentication tag.

Affected products

  • web-token jwt-experimental <= 4.1.6
  • web-token jwt-library < 3.4.10, >= 4.0.0 < 4.0.7, >= 4.1.0 < 4.1.7

Timeline

  • 2026-06-06: disclosed
  • 2026-06-18: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.