CVE-2024-51744
Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous situations in golang-jwt
Also known as GHSA-29wx-vh33-7x7r, GO-2024-3250
Mitigation
- Upgrade github.com/golang-jwt/jwt/v4 to 4.5.1 or later.
Who should check
- Projects that depend on Go package github.com/golang-jwt/jwt/v4 (< 4.5.1)
- Anyone running golang-jwt jwt < 4.5.1
Vulnerability facts
- Affected
- github.com/golang-jwt/jwt/v4 < 4.5.1
- Fixed in
- 4.5.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 3.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: Low
- Integrity impact: None
- Availability impact: None
- EPSS
- 0.65% chance of exploitation in 30 days (percentile 46, 2026-11-26)
- CWE
- CWE-755
- Modified
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 all errors ("dangerous" ones first), so that you are not running in the case detailed above.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go github.com/golang-jwt/jwt/v4 | < 4.5.1 | 4.5.1 | osv |
| golang-jwt jwt | < 4.5.1 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-51744. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-51744.md Affected: github.com/golang-jwt/jwt/v4 < 4.5.1 Fixed in: 4.5.1 Steps: 1. Search this machine and project for github.com/golang-jwt/jwt/v4 (Go), golang-jwt jwt: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2024-51744 being exploited?
There is no confirmed exploitation: CVE-2024-51744 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.65% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-51744?
Low: CVSS 3.1 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-51744?
github.com/golang-jwt/jwt/v4 < 4.5.1.
Is there a fix for CVE-2024-51744?
Yes. Fixed in 4.5.1. Upgrade github.com/golang-jwt/jwt/v4 to 4.5.1 or later.
How do I check if I'm affected by CVE-2024-51744?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.