CVE-2026-49852

joserfc: HS256/HS384/HS512 verify accepts empty/nil HMAC key (cross-language sibling of CVE-2026-45363)

Published Jul 17, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
joserfc is a Python library that provides an implementation of several JSON Object Signing and Encryption (JOSE) standards. Prior to 1.6.8, joserfc.jwt.decode accepts attacker-forged HMAC-signed tokens when the caller-supplied verification key is the empty string or None, because HMACAlgorithm.sign and HMACAlgorithm.verify in src/joserfc/_rfc7518/jws_algs.py pass the output of OctKey.get_op_key(...) to hmac.new(...) and OctKey.import_key in src/joserfc/_rfc7518/oct_key.py only emits a SecurityWarning for keys shorter than 14 bytes without rejecting zero-length input. This issue is fixed in version 1.6.8.

Analysis

AI-generated

Technical impact

joserfc, a Python library for JOSE, was missing validation for the HMAC key used during token verification. An attacker can supply an empty string or None as the signing key, allowing the library to verify HMAC‑signed tokens that were forged. The JWT can be accepted without a valid signature, giving attackers the ability to impersonate any user or obtain unauthorized access categorized under), CWE‑287 (Improper Authentication), and CWE‑326 (Insufficient Key Size).

Affected Systems

The vulnerability affects all installations of the authlib:joserfc library prior to version 1.6.8. Systems that import joserfc for decoding and use older releases are at risk. Any Python application that relies on this library for authentication or authorization could be compromised if the vulnerable version is in use.

Risk and Exploitability

The CVSS score of 8.7 classifies this flaw as high severity, indicating a substantial impact when exploited. The EPSS score is less than 1%, suggesting low current exploitation probability, and it is not listed in CISA’s KEV catalog. It is inferred from the description that attackers can achieve authentication bypass by supplying an empty or None key when calling joserfc.jwt.decode. The likely attack vector is straightforward: an attacker crafts a JWT with a valid header and payload, provides a None or empty key to the library, and the application will accept the token as authentic. Because the flaw allows forging of tokens without needing to know the real key, the risk is significant for any service that trusts joserfc for authentication.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade your installed joserfc package to version 1.6.8 or later to apply the vendor‑provided fix.
  • If an upgrade cannot be performed immediately, implement a pre‑validation step that ensures HMAC keys are non‑empty and meet the minimum key length before passing them to joserfc.jwt.decode.
  • Review and harden authentication logic in your codebase, ensuring that only cryptographically strong, non‑empty keys are used for JWT verification, and monitor authentication logs for suspicious token usage patterns.

Generated by OpenCVE AI on July 30, 2026 at 23:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-gg9x-qcx2-xmrh joserfc: HS256/HS384/HS512 verify accepts empty/nil HMAC key (cross-language sibling of CVE-2026-45363)
History
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Authlib
Authlib joserfc
Vendors & Products Authlib
Authlib joserfc
Type Values Removed Values Added
Description joserfc is a Python library that provides an implementation of several JSON Object Signing and Encryption (JOSE) standards. Prior to 1.6.8, joserfc.jwt.decode accepts attacker-forged HMAC-signed tokens when the caller-supplied verification key is the empty string or None, because HMACAlgorithm.sign and HMACAlgorithm.verify in src/joserfc/_rfc7518/jws_algs.py pass the output of OctKey.get_op_key(...) to hmac.new(...) and OctKey.import_key in src/joserfc/_rfc7518/oct_key.py only emits a SecurityWarning for keys shorter than 14 bytes without rejecting zero-length input. This issue is fixed in version 1.6.8.
Title joserfc: HS256/HS384/HS512 verify accepts empty/nil HMAC key (cross-language sibling of CVE-2026-45363)
Weaknesses CWE-1391
CWE-287
CWE-326
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 20, 2026, 2:58 PM
Reserved
Jun 1, 2026, 10:03 PM
Status
Deferred
Published
Jul 17, 2026, 8:17 PM
Modified
Oct 24, 2026, 8:10 PM