{"id":"CVE-2024-53861","aliases":["CVE-2024-53861","GHSA-75c5-xw7c-p5pm","PYSEC-2026-1814"],"related":[],"kind":"vulnerability","state":"published","title":"Issuer field partial matches allowed in pyjwt","summary":"pyjwt is a JSON Web Token implementation in Python. An incorrect string comparison is run for `iss` checking, resulting in `\"acb\"` being accepted for `\"_abc_\"`. This is a bug introduced in version 2.10.0: checking the \"iss\" claim changed from `isinstance(issuer, list)` to `isinstance(issuer, Sequence)`. Since str is a Sequnce, but not a list, `in` is also used for string comparison. This results in `if \"abc\" not in \"__abcd__\":` being checked instead of `if \"abc\" != \"__abc__\":`. Signature checks are still present so real world impact is likely limited to denial of service scenarios. This issue has been patched in version 2.10.1. All users are advised to upgrade. There are no known workarounds for this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pyjwt is a JSON Web Token implementation in Python. An incorrect string comparison is run for `iss` checking, resulting in `\"acb\"` being accepted for `\"_abc_\"`. This is a bug introduced in version 2.10.0: checking the \"iss\" claim changed from `isinstance(issuer, list)` to `isinstance(issuer, Sequence)`. Since str is a Sequnce, but not a list, `in` is also used for string comparison. This results in `if \"abc\" not in \"__abcd__\":` being checked instead of `if \"abc\" != \"__abc__\":`. Signature checks are still present so real world impact is likely limited to denial of service scenarios. This issue has been patched in version 2.10.1. All users are advised to upgrade. There are no known workarounds for this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe wrong string if check is run for `iss` checking, resulting in `\"acb\"` being accepted for `\"_abc_\"`.\n\n### Details\nThis is a bug introduced in version [2.10.0](https://github.com/jpadilla/pyjwt/commit/1570e708672aa9036bc772476beae8bfa48f4131#diff-6893ad4a1c5a36b8af3028db8c8bc3b62418149843fc382faf901eaab008e380R366): checking the \"iss\" claim\nchanged from `isinstance(issuer, list)` to `isinstance(issuer,\nSequence)`.\n\n```diff\n-        if isinstance(issuer, list):\n+        if isinstance(issuer, Sequence):\n            if payload[\"iss\"] not in issuer:\n                raise InvalidIssuerError(\"Invalid issuer\")\n        else:\n```\n\nSince str is a Sequnce, but not a list, `in` is also used for string\ncomparison. This results in `if \"abc\" not in \"__abcd__\":` being\nchecked instead of `if \"abc\" != \"__abc__\":`.\n### PoC\nCheck out the unit tests added here: https://github.com/jpadilla/pyjwt-ghsa-75c5-xw7c-p5pm\n```python\n        issuer = \"urn:expected\"\n\n        payload = {\"iss\": \"urn:\"}\n\n        token = jwt.encode(payload, \"secret\")\n\n        # decode() succeeds, even though `\"urn:\" != \"urn:expected\". No exception is raised.\n        with pytest.raises(InvalidIssuerError):\n            jwt.decode(token, \"secret\", issuer=issuer, algorithms=[\"HS256\"])\n```\n\n\n### Impact\n\nI would say the real world impact is not that high, seeing as the signature still has to match. We should still fix it.","format":"markdown","source":"ghsa"},{"lang":"es","text":"pyjwt es una implementación de JSON Web Token en Python. Se ejecuta una comparación de cadena incorrecta para la comprobación de `iss`, lo que da como resultado que `\"acb\"` se acepte en lugar de `\"_abc_\"`. Este es un error introducido en la versión 2.10.0: la comprobación de la reclamación \"iss\" cambió de `isinstance(issuer, list)` a `isinstance(issuer, Sequence)`. Dado que str es una secuencia, pero no una lista, `in` también se utiliza para la comparación de cadenas. Esto da como resultado que se compruebe `if \"abc\" not in \"__abcd__\":` en lugar de `if \"abc\" != \"__abc__\":`. Las comprobaciones de firma aún están presentes, por lo que es probable que el impacto en el mundo real se limite a escenarios de denegación de servicio. Este problema se ha corregido en la versión 2.10.1. Se recomienda a todos los usuarios que actualicen. No existen workarounds conocidos para esta vulnerabilidad.","source":"nvd"}],"published":"2024-11-29T18:43:07.644Z","modified":"2026-09-10T03:50:21.333Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.2,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.2,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"}],"cwes":["CWE-697"],"affected":[{"ranges":[{"version":"= 2.10.0","status":"affected"}],"vendor":"jpadilla","product":"pyjwt","source":"cvelist"},{"ranges":[{"version":"2.10.0","status":"affected"}],"vendor":"pyjwt_project","product":"pyjwt","cpe":"cpe:2.3:a:pyjwt_project:pyjwt:2.10.0:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"pyjwt","purl":"pkg:pypi/pyjwt","source":"ghsa"},{"ranges":[{"status":"affected","version":"2.10.0"}],"vendor":"pyjwt_project","product":"pyjwt","cpe":"cpe:2.3:a:pyjwt_project:pyjwt:2.10.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"pyjwt","purl":"pkg:pypi/pyjwt","source":"pysec"}],"references":[{"url":"https://github.com/jpadilla/pyjwt/security/advisories/GHSA-75c5-xw7c-p5pm","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jpadilla/pyjwt/commit/1570e708672aa9036bc772476beae8bfa48f4131#diff-6893ad4a1c5a36b8af3028db8c8bc3b62418149843fc382faf901eaab008e380R366","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jpadilla/pyjwt/commit/33022c25525c1020869c71ce2a4109e44ae4ced1","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53861","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/jpadilla/pyjwt","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pyjwt","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-75c5-xw7c-p5pm","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-12-02T11:10:51.855Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-53861","url":"https://www.cve.org/CVERecord?id=CVE-2024-53861","licence":"CVE Terms of Use","modified":"2024-12-02T18:10:35.507Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-75c5-xw7c-p5pm","url":"https://github.com/advisories/GHSA-75c5-xw7c-p5pm","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:21.333Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-53861","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53861","licence":"Public domain","modified":"2026-06-17T08:09:25.893Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1814","url":"https://osv.dev/vulnerability/PYSEC-2026-1814","licence":"CC-BY-4.0","modified":"2026-07-07T17:48:03.529Z"}],"updatedAt":"2026-11-25T22:58:49.553Z","epss":{"score":0.00832,"percentile":0.58716,"date":"2026-12-01T12:00:22.000Z"}}