Skip to content
Heist/ feed
Back to feed
Low

golang-github-golang-jwt-jwt, golang-github-golang-jwt-jwt-v5 — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2024-51744

golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims` can lead to situation where users are potentially not checking errors in the way they should be. Especially, if a token is both expired and invalid, the errors returned by `ParseWithClaims` return both error codes. If users only check for the `jwt.ErrTokenExpired ` using `error.Is`, they will ignore the embedded `jwt.ErrTokenSignatureInvalid` and thus potentially accept invalid tokens. A fix has been back-ported with the error handling logic from the `v5` branch to the `v4` branch. In this logic, the `ParseWithClaims` function will immediately return in "dangerous" situations (e.g., an invalid signature), limiting the combined errors only to situations where the signature is valid, but further validation failed (e.g., if the signature is valid, but is expired AND has the wrong audience). This fix is part of the 4.5.1 release. We are aware that this changes the behaviour of an established function and is not 100 % backwards compatible, so updating to 4.5.1 might break your code. In case you cannot update to 4.5.0, please make sure that you are properly checking for all errors ("dangerous" ones first), so that you are not running in the case detailed above.

Products
golang-github-golang-jwt-jwt, golang-github-golang-jwt-jwt-v5
Affected versions
4.1.0-1, 4.1.0-2, 4.2.0-1, 4.2.0-1ubuntu0.1, 4.4.3-1build1, 5.0.0+really4.5.0-1, 5.0.0+really4.5.2-1, 5.0.0+really4.5.2-1build1, 5.2.0-2, 5.2.2-1, 5.3.0-1, 5.3.1-1
Fixed versions
Not specified
CVEs
CVE-2024-51744
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 01:10 UTC · Revision 1

Source evidence

UBUNTU-CVE-2024-51744

core-osv · Original source

Published 4 Nov 2024, 22:15 UTC

golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims` can lead to situation where users are potentially not checking errors in the way they should be. Especially, if a token is both expired and invalid, the errors returned by `ParseWithClaims` return both error codes. If users only check for the `jwt.ErrTokenExpired ` using `error.Is`, they will ignore the embedded `jwt.ErrTokenSignatureInvalid` and thus potentially accept invalid tokens. A fix has been back-ported with the error handling logic from the `v5` branch to the `v4` branch. In this logic, the `ParseWithClaims` function will immediately return in "dangerous" situations (e.g., an invalid signature), limiting the combined errors only to situations where the signature is valid, but further validation failed (e.g., if the signature is valid, but is expired AND has the wrong audience). This fix is part of the 4.5.1 release. We are aware that this changes the behaviour of an established function and is not 100 % backwards compatible, so updating to 4.5.1 might break your code. In case you cannot update to 4.5.0, please make sure that you are properly checking for all errors ("dangerous" ones first), so that you are not running in the case detailed above.

osv:UBUNTU-CVE-2024-51744

golang-github-golang-jwt-jwt

Fixed versions: Not specified

golang-github-golang-jwt-jwt

Fixed versions: Not specified

golang-github-golang-jwt-jwt-v5

Fixed versions: Not specified

golang-github-golang-jwt-jwt

Fixed versions: Not specified

golang-github-golang-jwt-jwt-v5

Fixed versions: Not specified

golang-github-golang-jwt-jwt

Fixed versions: Not specified

golang-github-golang-jwt-jwt-v5

Fixed versions: Not specified

golang-github-golang-jwt-jwt

Fixed versions: Not specified

golang-github-golang-jwt-jwt-v5

Fixed versions: Not specified

Complete source record
{
  "id": "6cccfcb8417e30139b9c41f13aa0619ccb605a3dc9899dcc551366fc9650cb17",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2024-51744",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2024-51744",
    "summary": "golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims` can lead to situation where users are potentially not checking errors in the way they should be. Especially, if a token is both expired and invalid, the errors returned by `ParseWithClaims` return both error codes. If users only check for the `jwt.ErrTokenExpired ` using `error.Is`, they will ignore the embedded `jwt.ErrTokenSignatureInvalid` and thus potentially accept invalid tokens. A fix has been back-ported with the error handling logic from the `v5` branch to the `v4` branch. In this logic, the `ParseWithClaims` function will immediately return in \"dangerous\" situations (e.g., an invalid signature), limiting the combined errors only to situations where the signature is valid, but further validation failed (e.g., if the signature is valid, but is expired AND has the wrong audience). This fix is part of the 4.5.1 release. We are aware that this changes the behaviour of an established function and is not 100 % backwards compatible, so updating to 4.5.1 might break your code. In case you cannot update to 4.5.0, please make sure that you are properly checking for all errors (\"dangerous\" ones first), so that you are not running in the case detailed above.",
    "evidence": "osv:UBUNTU-CVE-2024-51744",
    "products": [
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.1.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.1.0-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.2.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.2.0-1ubuntu0.1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.4.3-1build1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "5.0.0+really4.5.0-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt-v5",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.2.0-2",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.0.0+really4.5.2-1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt-v5",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.2.2-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.0.0+really4.5.2-1build1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt-v5",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.3.0-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "5.3.1-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.0.0+really4.5.2-1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "5.0.0+really4.5.2-1build1",
            "evidence": "/affected/7/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-golang-jwt-jwt-v5",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "5.2.2-1",
            "evidence": "/affected/8/versions"
          },
          {
            "value": "5.3.0-1",
            "evidence": "/affected/8/versions"
          }
        ]
      }
    ],
    "severity": "low",
    "structured": {
      "id": "UBUNTU-CVE-2024-51744",
      "aliases": [
        "UBUNTU-CVE-2024-51744"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "4.1.0-1",
            "4.1.0-2",
            "4.2.0-1",
            "4.2.0-1ubuntu0.1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-dev",
                "binary_version": "4.2.0-1ubuntu0.1"
              },
              {
                "binary_name": "jwt",
                "binary_version": "4.2.0-1ubuntu0.1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "4.4.3-1build1",
            "5.0.0+really4.5.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-dev",
                "binary_version": "5.0.0+really4.5.0-1"
              },
              {
                "binary_name": "jwt",
                "binary_version": "5.0.0+really4.5.0-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt-v5",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt-v5?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "5.2.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-v5-dev",
                "binary_version": "5.2.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "5.0.0+really4.5.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-dev",
                "binary_version": "5.0.0+really4.5.2-1"
              },
              {
                "binary_name": "jwt",
                "binary_version": "5.0.0+really4.5.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt-v5",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt-v5?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "5.2.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-v5-dev",
                "binary_version": "5.2.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "5.0.0+really4.5.2-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-dev",
                "binary_version": "5.0.0+really4.5.2-1build1"
              },
              {
                "binary_name": "jwt",
                "binary_version": "5.0.0+really4.5.2-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt-v5",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt-v5?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "5.3.0-1",
            "5.3.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-v5-dev",
                "binary_version": "5.3.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "5.0.0+really4.5.2-1",
            "5.0.0+really4.5.2-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-dev",
                "binary_version": "5.0.0+really4.5.2-1build1"
              },
              {
                "binary_name": "jwt",
                "binary_version": "5.0.0+really4.5.2-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-golang-jwt-jwt-v5",
            "purl": "pkg:deb/ubuntu/golang-github-golang-jwt-jwt-v5?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "5.2.2-1",
            "5.3.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-51744.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-golang-jwt-jwt-v5-dev",
                "binary_version": "5.3.0-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:40.206864312Z",
      "provider": "osv",
      "upstream": [
        "CVE-2024-51744"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2024-51744",
        "https://www.cve.org/CVERecord?id=CVE-2024-51744",
        "https://github.com/golang-jwt/jwt/security/advisories/GHSA-29wx-vh33-7x7r",
        "https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2024-51744",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 355932,
  "published_at": "2024-11-04T22:15:00+00:00"
}