PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
### Summary `PyJWT.decode()`/`decode_complete()` mutates a caller-supplied `options` dict in place whenever `verify_signature` is falsy, adding `verify_exp`/`verify_nbf`/`verify_iat`/`verify_aud`/`verify_iss`/`verify_sub`/`verify_jti` keys directly onto that object. If application code reuses the same `options` dict across calls (a config object, a module-level constant, a wrapper's `self.options`), a later call that explicitly sets `verify_signature=True` for a full, normal verification silently inherits the leftover `verify_exp=False` etc. from an earlier `verify_signature=False` call on the same object -- and accepts an expired, wrong-audience, wrong-issuer, or wrong-subject token as valid with no exception. Signature verification itself is unaffected; this is specifically a claims-check bypass. This is a regression of an already-fixed, closed issue: originally reported in #679 (2021), fixed in #743 (2022, via a shallow copy of `options`), and silently reintroduced by #1045 (merged 2025-03-05, a typing/logic refactor that dropped the 2022 shallow-copy line). It has been present since #1045 merged, so it likely shipped in several releases already in the wild. ### Details File: `jwt/api_jwt.py`, `PyJWT._merge_options()` (called from `decode_complete()`, which backs both `jwt.decode()` and `jwt.decode_complete()`): ```python def _merge_options(self, options=None): if options is None: return self.options if not options.get("verify_signature", True): options["verify_exp"] = opt
PYSEC-2026-4146
Revision 1
PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
### Summary `PyJWT.decode()`/`decode_complete()` mutates a caller-supplied `options` dict in place whenever `verify_signature` is falsy, adding `verify_exp`/`verify_nbf`/`verify_iat`/`verify_aud`/`verify_iss`/`verify_sub`/`verify_jti` keys directly onto that object. If application code reuses the same `options` dict across calls (a config object, a module-level constant, a wrapper's `self.options`), a later call that explicitly sets `verify_signature=True` for a full, normal verification silently inherits the leftover `verify_exp=False` etc. from an earlier `verify_signature=False` call on the same object -- and accepts an expired, wrong-audience, wrong-issuer, or wrong-subject token as valid with no exception. Signature verification itself is unaffected; this is specifically a claims-check bypass. This is a regression of an already-fixed, closed issue: originally reported in #679 (2021), fixed in #743 (2022, via a shallow copy of `options`), and silently reintroduced by #1045 (merged 2025-03-05, a typing/logic refactor that dropped the 2022 shallow-copy line). It has been present since #1045 merged, so it likely shipped in several releases already in the wild. ### Details File: `jwt/api_jwt.py`, `PyJWT._merge_options()` (called from `decode_complete()`, which backs both `jwt.decode()` and `jwt.decode_complete()`): ```python def _merge_options(self, options=None): if options is None: return self.options if not options.get("verify_signature", True): options["verify_exp"] = opt
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:PYSEC-2026-4146
pyjwt
Source reference: /affected/0/package/name
- Affected versions
- 2.11.0
Source reference:
/affected/0/versions2.12.0Source reference:
/affected/0/versions2.12.1Source reference:
/affected/0/versions2.13.0Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.11.0"
},
{
"last_affected": "2.13.0"
}
]
}
],
"package": {
"name": "pyjwt",
"purl": "pkg:pypi/pyjwt",
"ecosystem": "PyPI"
},
"versions": [
"2.11.0",
"2.12.0",
"2.12.1",
"2.13.0"
],
"database_specific": {
"source": "https://github.com/pypa/advisory-database/blob/main/vulns/pyjwt/PYSEC-2026-4146.yaml"
}
}
]- Related CVEs
- CVE-2026-103001
Source reference:
/aliases
Publisher severity
No explicit severity was provided.
- Event
- #62514 · Revision 1
- Added to Heist Feed
- Publisher date
GHSA-gvp8-978c-rx2q
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-gvp8-978c-rx2q
pyjwt
Source reference: /affected/0/package/name
- Affected versions
- 2.11.0
Source reference:
/affected/0/versions2.12.0Source reference:
/affected/0/versions2.12.1Source reference:
/affected/0/versions2.13.0Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.11.0"
},
{
"last_affected": "2.13.0"
}
]
}
],
"package": {
"name": "pyjwt",
"purl": "pkg:pypi/pyjwt",
"ecosystem": "PyPI"
},
"versions": [
"2.11.0",
"2.12.0",
"2.12.1",
"2.13.0"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-gvp8-978c-rx2q/GHSA-gvp8-978c-rx2q.json"
}
}
]- Related CVEs
- CVE-2026-103001
Source reference:
/aliases
Publisher severity
No explicit severity was provided.
- Event
- #62550 · Revision 1
- Added to Heist Feed
- Publisher date