Description
Mojo::JWT versions before 1.02 for Perl verify HMAC signatures with a non-constant-time string comparison.

The decode() method compares the supplied signature to the recomputed HMAC with Perl's eq operator, which stops at the first differing byte, so the comparison time varies with the number of matching leading bytes.

A caller that decodes attacker supplied tokens leaks the expected signature through this timing variation, which can be aggregated over many requests to recover the signature and forge a token.
Published: 2026-07-17
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Mojo::JWT versions earlier than 1.02 verify the HMAC of JSON Web Tokens by comparing the supplied signature to the recomputed one with Perl's direct equality operator, which stops as soon as a differing byte is found. This non‑constant‑time comparison leaks measurable timing information to a caller that decodes attacker‑supplied tokens. By sending a large number of crafted tokens and measuring the response times, an adversary can recover the exact signature and then forge a valid JWT, enabling them to bypass authentication or authorization checks.

Affected Systems

All installations of the JBERGER Mojo::JWT Perl library older than version 1.02 are affected. The issue arises wherever the library’s decode() function is invoked to validate tokens supplied by external users.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity; the EPSS score is less than 1 %, signifying currently low but non‑zero exploitation probability. Nevertheless, the attack requires only repeated token decoding and timing measurement, a capability readily available to anyone with network access to the service. The vulnerability is not present in the CISA KEV catalog.

Generated by OpenCVE AI on July 31, 2026 at 00:15 UTC.

Remediation

Vendor Solution

Upgrade to Mojo-JWT 1.02, which compares signatures with the constant-time Mojo::Util::secure_compare.


OpenCVE Recommended Actions

  • Upgrade to Mojo::JWT 1.02 or later, which uses constant‑time comparison via Mojo::Util::secure_compare.
  • If an upgrade cannot be performed immediately, mitigate the side‑channel by throttling or rate‑limiting decode requests from untrusted clients to reduce attack latency granularity.
  • Consider replacing Mojo::JWT with a JWT implementation that guarantees constant‑time signature verification, or wrap the decode logic in custom code that performs a constant‑time comparison before accepting the token.

Generated by OpenCVE AI on July 31, 2026 at 00:15 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Jberger
Jberger mojo::jwt
Vendors & Products Jberger
Jberger mojo::jwt

Mon, 20 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 17 Jul 2026 16:00:00 +0000

Type Values Removed Values Added
Description Mojo::JWT versions before 1.02 for Perl verify HMAC signatures with a non-constant-time string comparison. The decode() method compares the supplied signature to the recomputed HMAC with Perl's eq operator, which stops at the first differing byte, so the comparison time varies with the number of matching leading bytes. A caller that decodes attacker supplied tokens leaks the expected signature through this timing variation, which can be aggregated over many requests to recover the signature and forge a token.
Title Mojo::JWT versions before 1.02 for Perl verify HMAC signatures with a non-constant-time string comparison
Weaknesses CWE-208
References

Subscriptions

Jberger Mojo::jwt
cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-07-20T19:37:04.413Z

Reserved: 2026-05-25T20:46:44.842Z

Link: CVE-2026-9537

cve-icon Vulnrichment

Updated: 2026-07-17T17:25:14.154Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T00:15:05Z

Weaknesses
  • CWE-208

    Observable Timing Discrepancy