On this page (6 sections)
On 26 November 2026 Ubuntu published USN-9212-1, covering two vulnerabilities in PyJWT, the widely used Python library for JSON Web Tokens. One lets an unauthenticated request turn a token check into an HTTP 500 error. The other can let an expired or otherwise invalid token pass claim checks, but only if your code reuses an options dictionary in a particular way.
If you run Python APIs, Flask or Django services, or Ubuntu servers that ship python3-jwt, this is worth a quick check. Both issues are rated medium, and the research does not report any exploitation in the wild.
What the two flaws are
CVE-2026-102265: deeply nested header causes a server error
PyJWT reads the token header as JSON before it checks the signature. According to the GitHub advisory, the parser only converted ValueError into PyJWT's own DecodeError. A header nested extremely deeply makes Python's JSON decoder raise RecursionError instead, which is not part of PyJWT's documented error hierarchy. Code that wraps decoding in an except for PyJWT's errors therefore does not catch it.
No key or valid signature is needed, because the header is parsed first. The advisory says the effect is that a request returns HTTP 500 instead of 401 and writes a full traceback to the error log. The reporter describes it as a cheap, repeatable denial of service on the authentication path, with no crash of the worker and no data exposure in their test setup.
The reporter notes a limit: the nesting needed is very large (roughly 65,000 levels in their testing), so the token cannot fit in an Authorization header under typical HTTP field limits. Endpoints that accept a token in a request body, such as token introspection style APIs, are the realistic target.
CVE-2026-103001: options dictionary reuse skips claim checks
This is a regression. The advisory explains that when verify_signature is false, PyJWT wrote extra keys such as verify_exp and verify_aud into the options dictionary that the caller passed in. If the same dictionary is later reused for a call with verify_signature set to true, those leftover false values remain. A correctly signed token that is expired, or has the wrong audience, issuer, subject or token ID, is then accepted without an exception.
Signature verification itself is not bypassed. Applications that build a fresh options dictionary for every call are not affected. The risky pattern is a shared module-level constant, config object or instance attribute used for both an "inspect without verifying" call and a later fully verified call.
Who is realistically exposed
- Ubuntu 22.04, 24.04 and 26.04 LTS systems with the python3-jwt package, including anything that imports it system-wide.
- Applications that install PyJWT through pip in a virtualenv or container image. Ubuntu's update does not touch these.
- APIs that accept JWTs in a JSON or form body, which are the practical route for the nested header problem.
- Code that calls decode() with options={"verify_signature": False} and later reuses the same dictionary for verified decoding.
Treat the upstream version ranges with some care. The advisory for CVE-2026-102265 says it was tested on 2.13.0 and that any version whose header parsing translates only ValueError is affected, so older releases may also be vulnerable even though the recorded range starts at 2.13.0. Ubuntu shipped fixes for much older package versions, which fits that reading.
How to check your exposure
Start with the installed version. This command, run inside the Python environment your application uses, prints the PyJWT version from pip. Compare it with the ranges above.
pip show pyjwtOn Ubuntu, this command lists the installed python3-jwt package and its version. You are looking for a version at or above the fixed one for your release.
apt list --installed python3-jwtThen review your code for the second issue. This grep, run from your project root, finds decode calls that set verify_signature, so you can see whether any options dictionary is shared between calls.
grep -rn "verify_signature" --include=*.py .Also search your application error logs for unexpected RecursionError tracebacks coming from jwt/api_jws.py, which would point to malformed tokens reaching the decoder.
What to do now
- Update Ubuntu hosts so python3-jwt reaches 2.10.1-4ubuntu1.5 (26.04 LTS), 2.7.0-1ubuntu0.6 (24.04 LTS) or 2.3.0-1ubuntu0.8 (22.04 LTS).
- Upgrade PyJWT to 2.14.0 or later in every virtualenv, container image and requirements file that pins it, then rebuild and redeploy.
- Search your code for any options dictionary reused across decode() or decode_complete() calls and build a fresh dictionary for each call.
- Avoid decoding with verify_signature disabled on the same options object you use for verified decoding.
- Make sure token validation handles unexpected exceptions and returns 401, not 500, for malformed input.
- Where tokens arrive in a request body, set a sensible maximum body size at your web server or reverse proxy.
Ubuntu states that a standard system update applies the fixes. This command refreshes package lists and upgrades only python3-jwt on Ubuntu.
sudo apt update && sudo apt install --only-upgrade python3-jwtFor applications that install PyJWT through pip, this command upgrades it in the active environment. Re-run your tests afterwards.
pip install --upgrade pyjwtAbout the unpatched upstream status for CVE-2026-103001
The upstream advisory for CVE-2026-103001 shows patched versions as none, although a fix commit exists that copies the options dictionary before modifying it. The 2.14.0 release page only points to a changelog, so the research does not confirm whether 2.14.0 includes that commit. Until you have verified that, do not rely on the version number alone. Fixing your own code to never reuse an options dictionary removes the precondition, and on Ubuntu 22.04 the patched package covers it.
Detection and monitoring
- Watch for spikes of HTTP 500 responses on login, token introspection and other authentication endpoints, especially with large request bodies.
- Alert on RecursionError tracebacks in application logs.
- Add a regression test to your suite that decodes with verify_signature false, then decodes the same expired token with verification enabled, and expects an expiration error.
- Keep dependency scanning in CI so future PyJWT advisories surface quickly.
For the wider picture on keeping outward-facing services in shape, see our guide on small business website security, and the security headers checker for a quick look at your public endpoints. A web application firewall can also help limit oversized request bodies, though it is no substitute for patching.
Timeline
| Date | Event |
|---|---|
| 2026-09-08 | Maintainers reproduce the options mutation behavior on PyJWT 2.13.0; GHSA-gvp8-978c-rx2q published |
| 2026-09-11 | PyJWT 2.14.0 released with the fix for the nested header issue; GHSA-8wjv-2p76-3863 published |
| 2026-09-28 | CVE-2026-102265 published |
| 2026-09-30 | CVE-2026-103001 published |
| 2026-11-26 | Ubuntu publishes USN-9212-1 |
Sources
This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.
- CVE-2026-102265 - GitHub Advisory Database
- Handle recursive JWS headers as decode errors · jpadilla/pyjwt@0657369
- Release 2.14.0 · jpadilla/pyjwt
- CVE-2026-103001 - GitHub Advisory Database
- Merge commit from fork · jpadilla/pyjwt@0c87c8c
- PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse (regression of #679)
- USN-9212-1: PyJWT vulnerabilities | Ubuntu security notices | Ubuntu
