Skip to content
Heist/ feed
Back to feed
Low

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-41106

JWT is a library to work with JSON Web Token and JSON Web Signature. Prior to versions 3.4.6, 4.0.4, and 4.1.5, users of HMAC-based algorithms (HS256, HS384, and HS512) combined with `Lcobucci\JWT\Signer\Key\LocalFileReference` as key are having their tokens issued/validated using the file path as hashing key - instead of the contents. The HMAC hashing functions take any string as input and, since users can issue and validate tokens, users are lead to believe that everything works properly. Versions 3.4.6, 4.0.4, and 4.1.5 have been patched to always load the file contents, deprecated the `Lcobucci\JWT\Signer\Key\LocalFileReference`, and suggest `Lcobucci\JWT\Signer\Key\InMemory` as the alternative. As a workaround, use `Lcobucci\JWT\Signer\Key\InMemory` instead of `Lcobucci\JWT\Signer\Key\LocalFileReference` to create the instances of one's keys.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-41106
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:57 UTC · Revision 1

Source evidence

CVE-2021-41106

core-osv · Original source

Published 28 Sept 2021, 21:15 UTC

JWT is a library to work with JSON Web Token and JSON Web Signature. Prior to versions 3.4.6, 4.0.4, and 4.1.5, users of HMAC-based algorithms (HS256, HS384, and HS512) combined with `Lcobucci\JWT\Signer\Key\LocalFileReference` as key are having their tokens issued/validated using the file path as hashing key - instead of the contents. The HMAC hashing functions take any string as input and, since users can issue and validate tokens, users are lead to believe that everything works properly. Versions 3.4.6, 4.0.4, and 4.1.5 have been patched to always load the file contents, deprecated the `Lcobucci\JWT\Signer\Key\LocalFileReference`, and suggest `Lcobucci\JWT\Signer\Key\InMemory` as the alternative. As a workaround, use `Lcobucci\JWT\Signer\Key\InMemory` instead of `Lcobucci\JWT\Signer\Key\LocalFileReference` to create the instances of one's keys.

osv:CVE-2021-41106
Complete source record
{
  "id": "4569b812c38f85a5f972ceb9b039b04c385543ed80591982efb44c1e1c32c3f9",
  "url": "https://osv.dev/vulnerability/CVE-2021-41106",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-41106",
    "summary": "JWT is a library to work with JSON Web Token and JSON Web Signature. Prior to versions 3.4.6, 4.0.4, and 4.1.5, users of HMAC-based algorithms (HS256, HS384, and HS512) combined with `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference` as key are having their tokens issued/validated using the file path as hashing key - instead of the contents. The HMAC hashing functions take any string as input and, since users can issue and validate tokens, users are lead to believe that everything works properly. Versions 3.4.6, 4.0.4, and 4.1.5 have been patched to always load the file contents, deprecated the `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference`, and suggest `Lcobucci\\JWT\\Signer\\Key\\InMemory` as the alternative. As a workaround, use `Lcobucci\\JWT\\Signer\\Key\\InMemory` instead of `Lcobucci\\JWT\\Signer\\Key\\LocalFileReference` to create the instances of one's keys.",
    "evidence": "osv:CVE-2021-41106",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2021-41106",
      "aliases": [
        "CVE-2021-41106",
        "GHSA-7322-jrq4-x5hf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/lcobucci/jwt",
              "type": "GIT",
              "events": [
                {
                  "introduced": "320b9f05741b24acbbaf1106ed267ff3817fd74d"
                },
                {
                  "fixed": "3ef8657a78278dfeae7707d51747251db4176240"
                },
                {
                  "introduced": "6d8665ccd924dc076a9b65d1ea8abe21d68f6958"
                },
                {
                  "fixed": "55564265fddf810504110bd68ca311932324b0e9"
                },
                {
                  "introduced": "2f533837091d0b76a89a059e7ed2b2732b2f459e"
                },
                {
                  "fixed": "fe2d89f2eaa7087af4aa166c6f480ef04e000582"
                },
                {
                  "fixed": "8175de5b841fbe3fd97d2d49b3fc15c4ecb39a73"
                },
                {
                  "fixed": "c45bb8b961a8e742d8f6b88ef5ff1bd5cca5d01c"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:lcobucci:jwt:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "3.4.0"
                      },
                      {
                        "fixed": "3.4.6"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:lcobucci:jwt:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "4.0.0"
                      },
                      {
                        "fixed": "4.0.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:lcobucci:jwt:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "4.1.0"
                      },
                      {
                        "fixed": "4.1.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8175de5b841fbe3fd97d2d49b3fc15c4ecb39a73"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c45bb8b961a8e742d8f6b88ef5ff1bd5cca5d01c"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "4.1.4",
            "3.4.5",
            "4.0.3",
            "4.1.3",
            "4.0.2",
            "4.1.2",
            "4.1.1",
            "3.4.4",
            "4.1.0",
            "4.0.1",
            "3.4.3",
            "4.0.0",
            "3.4.2",
            "3.4.1",
            "3.4.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-41106.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:58.416315949Z",
      "provider": "osv",
      "references": [
        "https://github.com/lcobucci/jwt/commit/8175de5b841fbe3fd97d2d49b3fc15c4ecb39a73",
        "https://github.com/lcobucci/jwt/commit/c45bb8b961a8e742d8f6b88ef5ff1bd5cca5d01c",
        "https://github.com/lcobucci/jwt/security/advisories/GHSA-7322-jrq4-x5hf"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-41106",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 386598,
  "published_at": "2021-09-28T21:15:07.37+00:00"
}