Live threats

All CVEs / golang-jwt

CVE-2024-51744golang-jwt jwt

Low 3.1 No auth needed

Priority
34
CVSS 3.1
3.1
EPSS
0.6%
probability of exploitation in 30 days · percentile 46
Auth required
No
Published
Nov 4, 2024
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-755
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for jwt.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Go github.com/golang-jwt/jwt/v4 < 4.5.1 4.5.1 go get github.com/golang-jwt/jwt/v4@v4.5.1
Go github.com/golang-jwt/jwt/v4 < 4.5.1 4.5.1 go get github.com/golang-jwt/jwt/v4@v4.5.1

Per OSV / GitHub Advisories (GHSA-29wx-vh33-7x7r, GO-2024-3250). Check the version in your lockfile before upgrading.

Affected products

As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.

Official advisories

Also: SUSE (+1)

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.