Skip to content
Heist/ feed
Back to feed
Critical

PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard

Type: advisorySources: OSV

PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, is_pem_format in jwt/utils.py is affected because is_pem_format does not recognize every PEM representation accepted by the cryptography loader. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a mutated public-key PEM as raw key bytes. As a result, HMACAlgorithm.prepare_key treats the unrecognized asymmetric public key as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-102268
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 08:42 UTC · Revision 1

Source evidence

PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard

core-osv · Original source

Published 28 Sept 2026, 20:26 UTC

PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, is_pem_format in jwt/utils.py is affected because is_pem_format does not recognize every PEM representation accepted by the cryptography loader. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a mutated public-key PEM as raw key bytes. As a result, HMACAlgorithm.prepare_key treats the unrecognized asymmetric public key as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.

osv:CVE-2026-102268
Complete source record
{
  "id": "a6850eb89be3ff9ab791f82cb81a50ca99623c6763bb5c29712854685a3c9f13",
  "url": "https://osv.dev/vulnerability/CVE-2026-102268",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard",
    "summary": "PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, is_pem_format in jwt/utils.py is affected because is_pem_format does not recognize every PEM representation accepted by the cryptography loader. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a mutated public-key PEM as raw key bytes. As a result, HMACAlgorithm.prepare_key treats the unrecognized asymmetric public key as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.",
    "evidence": "osv:CVE-2026-102268",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2026-102268",
      "aliases": [
        "CVE-2026-102268",
        "GHSA-ffc3-869f-jxw9",
        "PYSEC-2026-4145"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/jpadilla/pyjwt",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "c6fe464b356ff4b1ebc9ba62172d331a40aa27df"
                },
                {
                  "fixed": "8b4e233a22206b34ec1186e912e75c0b2396ac07"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:pyjwt_project:pyjwt:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.14.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8b4e233a22206b34ec1186e912e75c0b2396ac07"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c6fe464b356ff4b1ebc9ba62172d331a40aa27df"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "2.14.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.13.0",
            "2.12.1",
            "2.12.0",
            "2.11.0",
            "2.10.1",
            "2.10.0",
            "2.9.0",
            "2.8.0",
            "2.7.0",
            "2.6.0",
            "2.5.0",
            "2.4.0",
            "2.3.0",
            "2.2.0",
            "2.1.0",
            "2.0.1",
            "2.0.0",
            "2.0.0a2",
            "2.0.0a1",
            "1.7.1",
            "1.7.0",
            "1.6.4",
            "1.6.3",
            "1.6.1",
            "1.6.0",
            "1.5.3",
            "1.5.2",
            "1.5.1",
            "1.5.0",
            "1.4.2",
            "1.4.1",
            "1.4.0",
            "1.3.0",
            "1.2.0",
            "1.1.0",
            "1.0.1",
            "1.0.0",
            "0.4.3",
            "0.4.2",
            "0.4.1",
            "0.4.0",
            "0.3.2",
            "0.3.1",
            "0.3.0",
            "0.2.3",
            "0.2.2",
            "0.2.0",
            "0.1.9",
            "0.1.6"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-102268.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:27.162487733Z",
      "provider": "osv",
      "references": [
        "https://github.com/jpadilla/pyjwt/releases/tag/2.14.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/102xxx/CVE-2026-102268.json",
        "https://github.com/jpadilla/pyjwt/security/advisories/GHSA-ffc3-869f-jxw9",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-102268",
        "https://github.com/jpadilla/pyjwt/commit/8b4e233a22206b34ec1186e912e75c0b2396ac07"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-347"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/102xxx/CVE-2026-102268.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-102268",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 493949,
  "published_at": "2026-09-28T20:26:13.674+00:00"
}