New from Wiz Research: Critical NGINX flaw. Understand the risk and impact.
Vulnerability DatabaseGHSA-g3gx-p6xp-9gxq

GHSA-g3gx-p6xp-9gxq: 
PHP vulnerability analysis and mitigation

Summary

Lcobucci\JWT\Signer\Ecdsa::verify() throws an unhandled error instead of returning false when given a correctly sized ECDSA signature (for example 64 bytes for ES256) whose R or S value has 17 or more leading zero bytes, such as R = 1 and S = 1. The cause is MultibyteStringConverter::toAsn1(), which writes the DER integer lengths with dechex() without zero-padding them to two hex digits, so hex2bin() receives an odd-length string and fails. An unauthenticated attacker who can submit a token to an application that verifies ES256/ES384/ES512 signatures can trigger this with a crafted signature, causing a server error rather than a clean authentication failure. It affects 5.6.1 and the current 6.0.x branch; the ConversionFailed handling added in 5.6.1 does not cover this path.

Details

Lcobucci\JWT\Signer\Ecdsa::verify() converts the raw (IEEE P1363) signature into DER before calling openssl_verify(). It does this with Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter::toAsn1(). toAsn1() removes the leading zero bytes from each of R and S. It then writes each INTEGER’s length, and the SEQUENCE’s total length, as hex with dechex($lengthR), dechex($lengthS) and dechex($totalLength). These values are not zero-padded to two hex digits. Once an integer shrinks to fewer than 16 bytes (17 or more leading zero bytes in a 32-byte half), its length is a single hex digit. The assembled hex string then has an odd length, and hex2bin() rejects it: hex2bin() raises the warning “Hexadecimal input string must have an even length” and returns false. Applications that convert warnings to exceptions, as Laravel and Symfony do by default, get an ErrorException. Without such a handler, the method’s string return type gives a TypeError. Version 5.6.1 added catch (ConversionFailed) in Ecdsa::verify(), but that exception is only thrown by the length check that comes earlier. This failure happens later, in hex2bin(), so it isn’t caught. Affected: 5.6.1, and the 6.0.x branch at the time of writing. The code is unchanged since at least 5.6.0.

Proof of concept

<?php require 'vendor/autoload.php'; use Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter; // 64-byte ES256 signature with R = 1 and S = 1 $sig = str_repeat("\0", 31) . "\x01" . str_repeat("\0", 31) . "\x01"; (new MultibyteStringConverter())->toAsn1($sig, 64); // => Warning/ErrorException: hex2bin(): Hexadecimal input string must have an even length ?> Steps:

  1. Take any ES256 token.
  2. Replace its signature segment with the base64url encoding of the 64 bytes above.
  3. Pass it to (new Sha256())->verify($signature, $payload, $publicKey), or to a Validator using the SignedWith constraint.

Impact

Any application that verifies untrusted ES256, ES384 or ES512 tokens with this library can be made to throw an unhandled error, instead of cleanly rejecting the token, by an unauthenticated attacker sending one crafted signature. The attacker needs no key and no valid token: the header and claims can be anything well formed. Depending on the application, the consequences include:

  • HTTP 500 responses instead of 401;
  • error-log and error-notification noise, such as alert emails, on every request;
  • bypass of logic that only runs on a false result, such as failed-attempt counters, rate limiting or audit logging.

Source: NVD

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hg3m-q4fj-ggmqCRITICAL9.3
  • PHP logoPHP
  • wallabag/wallabag
NoNoNov 20, 2026
CVE-2026-63012MEDIUM6.5
  • PHP logoPHP
  • baserproject/baser-core
NoYesNov 19, 2026
GHSA-crpp-mf59-rhpqMEDIUMN/A
  • PHP logoPHP
  • api-platform/core
NoYesNov 20, 2026
GHSA-9wh3-m3m5-jffxMEDIUMN/A
  • PHP logoPHP
  • nowo-tech/transaction-doctrine
NoYesNov 20, 2026
GHSA-65w2-9r4h-848gMEDIUMN/A
  • PHP logoPHP
  • nowo-tech/transaction-doctrine
NoYesNov 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management