Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-59936: CWE-116: Improper Encoding or Escaping of Output in nearform get-jwks

0
Critical
VulnerabilityCVE-2025-59936cvecve-2025-59936cwe-116
Published: Sat Sep 27 2025 (09/27/2025, 00:22:10 UTC)
Source: CVE Database V5
Vendor/Project: nearform
Product: get-jwks

Description

get-jwks contains fetch utils for JWKS keys. In versions prior to 11.0.2, a vulnerability in get-jwks can lead to cache poisoning in the JWKS key-fetching mechanism. When the iss (issuer) claim is validated only after keys are retrieved from the cache, it is possible for cached keys from an unexpected issuer to be reused, resulting in a bypass of issuer validation. This design flaw enables a potential attack where a malicious actor crafts a pair of JWTs, the first one ensuring that a chosen public key is fetched and stored in the shared JWKS cache, and the second one leveraging that cached key to pass signature validation for a targeted iss value. The vulnerability will work only if the iss validation is done after the use of get-jwks for keys retrieval. This issue has been patched in version 11.0.2.

AI-Powered Analysis

AILast updated: 10/05/2025, 00:57:17 UTC

Technical Analysis

CVE-2025-59936 is a critical vulnerability affecting versions of the nearform 'get-jwks' library prior to 11.0.2. The 'get-jwks' library is used to fetch JSON Web Key Sets (JWKS) for JWT signature verification. The vulnerability arises from a design flaw in the caching mechanism of JWKS keys. Specifically, the library caches keys fetched from issuers but performs issuer (iss) claim validation only after retrieving keys from the cache. This sequence allows an attacker to perform cache poisoning by first injecting a malicious public key into the shared JWKS cache associated with one issuer, and then leveraging that cached key to validate a JWT from a different, targeted issuer. This bypasses the intended issuer validation, enabling signature validation to succeed with a key that should not be trusted for that issuer. The attack requires no authentication or user interaction and can be executed remotely over the network, making exploitation relatively straightforward. The vulnerability is classified under CWE-116 (Improper Encoding or Escaping of Output), indicating issues with how output data is handled, which in this context relates to the improper handling of cached keys and issuer validation order. The flaw has been addressed in version 11.0.2 of 'get-jwks'. The CVSS v3.0 base score is 9.4 (critical), reflecting high impact on confidentiality and integrity with low attack complexity and no privileges or user interaction required. No known exploits are currently reported in the wild, but the severity and ease of exploitation make this a high-risk vulnerability for any systems relying on vulnerable versions of 'get-jwks' for JWT validation.

Potential Impact

For European organizations, this vulnerability poses a significant risk to the integrity and confidentiality of authentication and authorization processes that rely on JWTs validated using the 'get-jwks' library. Many modern web applications, APIs, and microservices use JWTs for stateless authentication and authorization, often fetching public keys dynamically from trusted issuers via JWKS endpoints. Exploitation of this vulnerability could allow attackers to impersonate legitimate users or services by forging JWTs that pass signature validation despite originating from untrusted issuers. This could lead to unauthorized access to sensitive data, privilege escalation, and potential lateral movement within networks. Given the critical nature of JWTs in identity and access management, the impact extends to compliance risks under GDPR and other data protection regulations if personal or sensitive data is exposed or manipulated. Additionally, organizations in sectors such as finance, healthcare, and government, which heavily rely on secure token validation, could face operational disruptions and reputational damage. The vulnerability's network-exploitable nature means that exposed APIs or services using vulnerable 'get-jwks' versions are at immediate risk, especially if they do not implement additional issuer validation safeguards outside the library.

Mitigation Recommendations

European organizations should urgently upgrade all instances of the 'get-jwks' library to version 11.0.2 or later, where the vulnerability is patched. Beyond upgrading, organizations should audit their JWT validation workflows to ensure that issuer (iss) claim validation occurs before or during key retrieval, not after, to prevent cache poisoning attacks. Implementing strict validation logic that tightly couples keys to their issuers and avoids shared caches across different issuers can mitigate risks. Additionally, organizations should consider deploying runtime monitoring and anomaly detection on JWT validation failures or unusual token usage patterns. Employing defense-in-depth by validating tokens at multiple layers, including API gateways and identity providers, can reduce exposure. Regularly reviewing and updating dependencies, combined with automated vulnerability scanning in CI/CD pipelines, will help prevent similar issues. Finally, organizations should review their incident response plans to quickly address any detected misuse of JWTs and notify affected stakeholders as required by GDPR and other regulations.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-09-23T14:33:49.505Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 68d7346479aa5c9d08557684

Added to database: 9/27/2025, 12:48:36 AM

Last enriched: 10/5/2025, 12:57:17 AM

Last updated: 11/12/2025, 4:24:14 AM

Views: 126

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats