DHI-6wou-dari-ghs3-wv5w
golang-jwt is a Go implementation of JSON Web Tokens. Unclear documentation of the error behavior in `ParseWithClaims`…
- CVSS
- —
- EPSS
- —
- Published
- 2026-11-20
- Age
- 11d old
- Modified
- 2026-11-24
- Product
- costmodel-dev
Description
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
Sources
- OSV · first seen 8d ago · CC-BY 4.0
References
- https://scout.docker.com/v/DHI-6wou-dari-ghs3-wv5w advisory
- https://nvd.nist.gov/vuln/detail/CVE-2024-51744 advisory
- https://alas.aws.amazon.com/AL2023/ALAS-2025-816.html advisory
- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-51744 advisory
- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-45338 advisory
- https://alas.aws.amazon.com/AL2023/ALAS-2025-834.html advisory
- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-45337 advisory
- https://alas.aws.amazon.com/AL2023/ALAS-2025-852.html advisory
- https://security-tracker.debian.org/tracker/CVE-2024-51744 advisory
- https://github.com/advisories/GHSA-29wx-vh33-7x7r advisory
- https://github.com/golang-jwt/jwt/security/advisories/GHSA-29wx-vh33-7x7r advisory
- https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c fix
- https://pkg.go.dev/vuln/GO-2024-3250 advisory
- https://access.redhat.com/security/cve/CVE-2024-51744 advisory
- https://www.cve.org/CVERecord?id=CVE-2024-51744 fix
- https://ubuntu.com/security/CVE-2024-51744 advisory
- http://people.ubuntu.com/~ubuntu-security/cve/CVE-2024-51744 advisory