Skip to content

[GHSA-9gxv-x7rp-r2hc] gree/jose - "None" Algorithm treated as valid in tokens#8014

Merged
advisory-database[bot] merged 1 commit into
RainSignal/advisory-improvement-8014from
RainSignal-GHSA-9gxv-x7rp-r2hc
Jul 16, 2026
Merged

[GHSA-9gxv-x7rp-r2hc] gree/jose - "None" Algorithm treated as valid in tokens#8014
advisory-database[bot] merged 1 commit into
RainSignal/advisory-improvement-8014from
RainSignal-GHSA-9gxv-x7rp-r2hc

Conversation

@RainSignal

Copy link
Copy Markdown

Updates

  • Affected products
  • CWEs

Comments

  1. Patched version exists (2.2.1)

The advisory states no solution is available, but version 2.2.1
contains a fix. The patch can be verified at:
https://github.com/nov/jose-php/blob/2.2.1/src/JOSE/JWS.php

The fix in 2.2.1 addresses the algorithm confusion attack in
_verify() by adding a $using_autodetected_alg flag. When the
algorithm is auto-detected from the JWT header (i.e. $expected_alg
is not explicitly provided by the caller), HMAC algorithms (HS256,
HS384, HS512) are now explicitly rejected with an exception:
"HMAC algs MUST be explicitly specified as $expected_alg"

This prevents attackers from changing the algorithm in the JWT
header from RS256 to HS256 and using the public key as the HMAC
secret to forge a valid signature.

  1. Additional fix: timing attack

Version 2.2.1 also fixes a timing attack vulnerability by replacing
direct string comparison (===) with hash_equals() for HMAC
signature verification, preventing timing-based side-channel attacks.

  1. Description is incorrect

The current description refers to vulnerabilities in other JWT
libraries (node-jsonwebtoken, pyjwt, namshi/jose, php-jwt, jsjwt)
and does not describe the actual vulnerability in gree/jose. The
correct description should be:

The _verify() method in JOSE_JWS trusts the algorithm specified
in the JWT header when $expected_alg is not explicitly provided
by the caller. This allows an attacker to change the algorithm
from RS256 to HS256 in the token header and sign the token using
the server's public key as the HMAC secret, bypassing signature
verification entirely.

Copilot stopped work on behalf of RainSignal due to an error June 11, 2026 18:07
@github-actions
github-actions Bot changed the base branch from main to RainSignal/advisory-improvement-8014 June 11, 2026 18:08
@github-actions

Copy link
Copy Markdown

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the Keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot. Please see CONTRIBUTING.md for more policy details.

@github-actions github-actions Bot added the Stale label Jul 16, 2026
@advisory-database
advisory-database Bot merged commit 1db909e into RainSignal/advisory-improvement-8014 Jul 16, 2026
4 checks passed
@advisory-database

Copy link
Copy Markdown
Contributor

Hi @RainSignal! Thank you so much for contributing to the GitHub Advisory Database. This database is free, open, and accessible to all, and it's people like you who make it great. Thanks for choosing to help others. We hope you send in more contributions in the future!

@advisory-database
advisory-database Bot deleted the RainSignal-GHSA-9gxv-x7rp-r2hc branch July 16, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant