CVE-2026-137563 in jwt-library
Summary
by MITRE • 11/26/2026
web-token jwt-framework from 4.2.1 before 4.2.6 contains an information disclosure vulnerability that exposes decryption keys in exception stack traces when JWE tokens are rejected. Attackers can submit crafted JWE tokens so JWELoader and JWEDecrypter record dir, AES key wrapping, PBES2-derived or content encryption keys in logged trace arguments readable by others.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/27/2026
The web-token jwt-framework library, specifically versions prior to 4.2.6, contains a critical information disclosure vulnerability that compromises the confidentiality of cryptographic material used in JSON Web Encryption (JWE) operations. This flaw manifests when the framework attempts to decrypt or validate JWE tokens and encounters an error condition during the decryption process. Instead of handling these errors securely by discarding sensitive intermediate values, the library inadvertently includes decrypted keys within exception stack traces that are subsequently logged. These logs may be accessible to unauthorized users depending on the logging configuration and infrastructure security posture, thereby exposing secrets such as direct encryption keys (dir), AES key wrapping keys, PBES2-derived keys, or content encryption keys.
From a technical perspective, this vulnerability stems from improper error handling practices within the JWELoader and JWEDecrypter components of the framework. When processing JWE tokens, these modules perform complex cryptographic operations that involve deriving or unwrapping sensitive keying material. If any step in this process fails due to malformed input, invalid signatures, or incorrect parameters, an exception is thrown. The implementation captures detailed context about the failure state for debugging purposes but fails to sanitize the stack trace arguments before logging them. Consequently, if a crafted JWE token triggers such an error path, the resulting log entry will contain plaintext representations of keys that were temporarily loaded into memory during decryption attempts. This behavior violates fundamental security principles regarding the handling of sensitive data in logs and exception messages.
The operational impact of this vulnerability is severe, as it allows attackers to recover cryptographic secrets through passive observation or active exploitation depending on access controls around log files. An attacker can submit specially crafted JWE tokens designed to trigger specific decryption failures that expose particular key types. By monitoring application logs, whether via direct file system access, centralized logging systems like ELK Stack or Splunk, or even error reporting services, the adversary can extract these keys. Once obtained, these keys can be used to decrypt other messages encrypted with the same key material if the algorithm supports it, such as in cases where a shared secret is reused across multiple tokens. This undermines the integrity and confidentiality guarantees provided by JWE encryption mechanisms.
This issue aligns with CWE-209: Generation of Error Message Containing Sensitive Information, which classifies vulnerabilities where error messages reveal sensitive data to unauthorized parties. Additionally, it relates to CWE-532: Insertion of Sensitive Information into Log File, highlighting the risk associated with logging internal state details that include cryptographic material. In terms of MITRE ATT&CK framework mapping, this vulnerability facilitates reconnaissance and credential access phases by allowing attackers to gather sensitive information from system logs without needing direct database or application logic exploitation beyond input manipulation.
To mitigate this vulnerability, organizations must upgrade the web-token jwt-framework library to version 4.2.6 or later where these logging practices have been corrected to exclude sensitive key material from exception traces. For environments unable to immediately patch, implementing strict log sanitization rules at the infrastructure level can help mask potential exposures by filtering out patterns resembling cryptographic keys in log outputs. Furthermore, developers should review application logging configurations to ensure that debug-level logs are not enabled in production environments unless absolutely necessary and properly secured with access controls limiting visibility to authorized personnel only. Regular audits of log contents for sensitive data leakage remain essential as part of a comprehensive security monitoring strategy.