Vulnerability in pyjwt (CVE-2026-102270)
Summary
Vulnerability in pyjwt (CVE-2026-102270). Risk of unauthorized operations or information disclosure. Exploitable via is_pem_format. Mitigation: upgrade to 2.14.0 or later.
Original description
The description as published by the source.
Summary
There is a Re-DoS vulnerability in the is_pem_format function which results in a intesive CPU usage if an attacker is been able to provide a custom certificate.
Details
The problem is that the lazy quantifier .+? will always first try to match as little as possible until it finds a ---- END. Normally this means the complexity of this should be O(N). However, by providing an input which consists only of ----BEGIN CERTIFICATE----- lines and no ---- END line, the regex algorithm will first try to match the first line and then, with the lazy quantifier, all the lines until the end O(N), which then fails since it is unable to find a ---- END line. It will then jump to the next line, resulting in N re-scans of the whole string, which means the complexity basically results in O(N²).
PoC
import time
import re
BEGIN_LINE = b"-----BEGIN CERTIFICATE-----\n"
_PEMS = {
b"CERTIFICATE",
b"TRUSTED CERTIFICATE",
b"PRIVATE KEY",
b"PUBLIC KEY",
b"ENCRYPTED PRIVATE KEY",
b"OPENSSH PRIVATE KEY",
b"DSA PRIVATE KEY",
b"RSA PRIVATE KEY",
b"RSA PUBLIC KEY",
b"EC PRIVATE KEY",
b"DH PARAMETERS",
b"NEW CERTIFICATE REQUEST",
b"CERTIFICATE REQUEST",
b"SSH2 PUBLIC KEY",
b"SSH2 ENCRYPTED PRIVATE KEY",
b"X509 CRL",
}
_PEM_RE = re.compile(
b"----[- ]BEGIN ("
+ b"|".join(_PEMS)
+ b""")[- ]----\r?
.+?\r?
----[- ]END \\1[- ]----\r?\n?""",
re.DOTALL,
)
def is_pem_format(key: bytes) -> b…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-102270 has been found in pyjwt.
Attackers can target a specific entry point like is_pem_format over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 4.4/10.
What to do: upgrade pyjwt to 2.14.0 or later.
If unsure, ask your IT team or search "pyjwt CVE-2026-102270" on the vendor's site.
CVE-2026-102270 (pyjwt) — CWE-1333 / CVSS v3 4.4
Attack vector: remote (network-reachable) / no user interaction
Attack surface: is_pem_format
Patched: 2.14.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-1333) exists in pyjwt. Attackers reach the vulnerable code path via is_pem_format.
Check the vendor advisory for the affected versions of pyjwt. Attack surface: is_pem_format.
Severity: Medium (CVSS 4.4/10). Risk of unauthorized operations or information disclosure.
Update to 2.14.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'pyjwt' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'pyjwt' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
pyjwtを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade pyjwt to 2.14.0ステージング環境で 2.14.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- exploit github.com
- patch security-advisories@github.com
- web security-advisories@github.com
- web nvd.nist.gov
- web github.com