<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>PyJWT - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/pyjwt/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 30 Sep 2026 04:18:49 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/pyjwt/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>PyJWT Asymmetric-PEM Detection Bypass Leading to Algorithm Confusion</title><link>https://feed.craftedsignal.io/briefs/2026-09-pyjwt-pem-bypass/</link><pubDate>Wed, 30 Sep 2026 04:18:49 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-09-pyjwt-pem-bypass/</guid><description>An incomplete asymmetric-key guard in PyJWT (CVE-2026-102268) allows specially formatted public keys to be used as HMAC secrets, enabling universal token forgery when applications misconfigure algorithm allow-lists.</description><content:encoded><![CDATA[<p>PyJWT versions 2.13.0 and earlier contain a security bypass in the <code>is_pem_format</code> utility that allows asymmetric public keys to be treated as symmetric HMAC secrets. This occurs because the library's internal regex-based PEM validator is overly strict, failing to recognize PEM-formatted keys that include marker-adjacent whitespace, bare carriage returns, or single-line folding. While the <code>cryptography</code> library correctly parses these mutated keys, PyJWT's guard mechanism - intended to prevent CVE-2022-29217 algorithm confusion - erroneously concludes they are not asymmetric keys. If an application's <code>jwt.decode</code> configuration includes both HMAC (e.g., HS256) and asymmetric algorithms, an attacker can leverage the public key as an HMAC secret to mint valid tokens with arbitrary claims. This vulnerability is critical for applications that fail to follow RFC 8725 best practices regarding algorithm allow-listing.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies an application that performs JWT verification with an overly permissive algorithm allow-list containing both asymmetric (e.g., RS256/ES256) and symmetric (e.g., HS256) algorithms.</li>
<li>The attacker obtains the application's public verification key.</li>
<li>The attacker applies specific whitespace or line-ending mutations to the public key PEM to bypass PyJWT's <code>is_pem_format</code> regex validation.</li>
<li>The attacker sends a malicious JWT, using the mutated public key as the HMAC shared secret to sign the token with <code>alg=HS256</code>.</li>
<li>The target application receives the JWT and passes the mutated key to <code>PyJWT.decode</code>.</li>
<li>The <code>HMACAlgorithm.prepare_key</code> function checks the mutated key against <code>is_pem_format</code>, which returns <code>False</code> due to the mutation.</li>
<li>The guard logic is bypassed, allowing the public key bytes to be used directly as the HMAC secret.</li>
<li>The application verifies the forged token as authentic, resulting in unauthorized access or privilege escalation.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows for universal token forgery, enabling an attacker to bypass authentication and impersonate any user, including high-privileged accounts. The vulnerability affects any service using PyJWT where developers have combined symmetric and asymmetric algorithms in the verification allow-list. While no active real-world incident was documented in the advisory, the potential impact is critical for any system relying on affected versions of PyJWT for identity or session management.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Upgrade PyJWT to version 2.14.0 or later immediately to incorporate the fix for CVE-2026-102268.</li>
<li>Audit all JWT verification logic to ensure algorithm allow-lists strictly adhere to RFC 8725, explicitly separating symmetric and asymmetric key paths.</li>
<li>Avoid mixing HMAC and RSA/ECDSA algorithms in a single allow-list entry.</li>
<li>Transition to the <code>PyJWK</code> verification path, which enforces strict algorithm binding and is unaffected by this vulnerability.</li>
</ol>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>jwt</category><category>authentication-bypass</category><category>cve-2026-102268</category><category>library-vulnerability</category></item></channel></rss>