GHSA-6vvh-pxr4-25r7: PHP JWT Framework Chacha20Poly1305 Key-encryption Algorithm Discards The Vulnerability

MODERATE
CWE-353 CWE-347
Published
Advisory Summary

GHSA-6vvh-pxr4-25r7 is a MODERATE chacha20poly1305 key-encryption algorithm discards the vulnerability (CWE-353: Missing Support for Integrity Check) affecting PHP JWT Framework libraries in the Packagist ecosystem. The issue involves chacha20poly1305 key-encryption algorithm discards the poly1305 authentication tag, performing no authentication on decryption. Remediation is available by upgrading affected packages to version 3.4.10, 4.0.7, 4.1.7.

GHSA-6vvh-pxr4-25r7 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6vvh-pxr4-25r7
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-353: Missing Support for Integrity Check
Affected Product PHP JWT Framework
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-6vvh-pxr4-25r7

To remediate this vulnerability, upgrade all affected PHP JWT Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

web-token/jwt-experimental fixed: Latest secure release
Upgrade web-token/jwt-experimental to Latest secure release
web-token/jwt-library fixed: 3.4.10
Upgrade web-token/jwt-library to 3.4.10
web-token/jwt-library fixed: 4.0.7
Upgrade web-token/jwt-library to 4.0.7
web-token/jwt-library fixed: 4.1.7
Upgrade web-token/jwt-library to 4.1.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for web-token/jwt-experimental

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6vvh-pxr4-25r7, inspect your project dependencies for PHP JWT Framework:

inspect dependencies for web-token/jwt-experimental

Analyze the terminal output to locate any version of PHP JWT Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-353: Missing Support for Integrity Check, where the product uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum. In PHP JWT Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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`.

GHSA-6vvh-pxr4-25r7 Affected PHP JWT Framework Versions

4 component(s)
Fixed Versions:
3.4.104.0.74.1.7
Product / Package Ecosystem Affected Versions Fixed Version
web-token/jwt-experimental
Packagist
≤ 4.1.6
web-token/jwt-library
Packagist
< 3.4.10
3.4.10
web-token/jwt-library
Packagist
≥ 4.0.0
< 4.0.7
4.0.7
web-token/jwt-library
Packagist
≥ 4.1.0
< 4.1.7
4.1.7

References

Frequently Asked Questions

What is GHSA-6vvh-pxr4-25r7?
GHSA-6vvh-pxr4-25r7 is a security vulnerability in PHP JWT Framework involving Chacha20Poly1305 key-encryption algorithm discards the Poly1305 authentication tag, performing no authentication on decryption under CWE-353: Missing Support for Integrity Check.
Which PHP JWT Framework versions are affected?
Affected versions include releases prior to 3.4.10, 4.0.7, 4.1.7 across affected packages: web-token/jwt-experimental, web-token/jwt-library.
What version fixes GHSA-6vvh-pxr4-25r7?
Upgrading to 3.4.10, 4.0.7, 4.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is web-token/jwt-experimental affected?
Yes, web-token/jwt-experimental is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is web-token/jwt-library affected?
Yes, web-token/jwt-library is affected in releases prior to 3.4.10, 4.0.7, 4.1.7. Upgrade your dependency to 3.4.10, 4.0.7, 4.1.7 or later.
What CWE is associated with GHSA-6vvh-pxr4-25r7?
GHSA-6vvh-pxr4-25r7 is classified under CWE-353: Missing Support for Integrity Check (The product uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.).
How can I check Packagist dependencies for GHSA-6vvh-pxr4-25r7?
Run the dependency tree command: 'inspect dependencies for web-token/jwt-experimental'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6vvh-pxr4-25r7",
  "modified" : "2026-06-18T21:08:15Z",
  "published" : "2026-06-18T21:08:15Z",
  "aliases" : [ ],
  "summary" : "PHP JWT Framework: Chacha20Poly1305 key-encryption algorithm discards the Poly1305 authentication tag, performing no authentication on decryption",
  "details" : "### Impact\n\nThe 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.\n\nAs 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.\n\n### Affected configurations\n\nApplications that register `Jose\\Experimental\\KeyEncryption\\Chacha20Poly1305` (package `web-token/jwt-experimental`) as a JWE `alg`.\n\n### Patches\n\n`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.\n\n> Note: this changes the wire format of tokens produced with this experimental algorithm (a `tag` header is now emitted and required).\n\n### Workarounds\n\nDo not use the experimental `Chacha20Poly1305` key-encryption algorithm for untrusted input until upgraded.\n\n### References\n\n- RFC 7539 / RFC 8439 (ChaCha20-Poly1305 AEAD)\n- CWE-353: Missing Support for Integrity Check\n\n## Résolution\n\nUn 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).\n\n**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.\n\n**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`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "web-token/jwt-experimental"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "web-token/jwt-library"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.4.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "web-token/jwt-library"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "web-token/jwt-library"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/web-token/jwt-framework/security/advisories/GHSA-6vvh-pxr4-25r7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/web-token/jwt-library/GHSA-6vvh-pxr4-25r7.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/web-token/jwt-framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347", "CWE-353" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T21:08:15Z",
    "nvd_published_at" : null
  }
}