# CVE-2024-51744: Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous situations in golang-jwt

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** LOW 3.1
- **CVSS:** 3.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.65% (percentile 46, 2026-11-26)
- **CWE:** CWE-755
- **Aliases:** GHSA-29wx-vh33-7x7r, GO-2024-3250
- **Published:** 2024-11-04T21:47:12.170Z
- **Modified:** 2026-09-10T03:50:20.232Z

## 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

## 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

- Go `github.com/golang-jwt/jwt/v4`: affected \< 4.5.1; fixed 4.5.1 (osv)
- golang-jwt jwt: \< 4.5.1 (cvelist)

## Mitigation

- Upgrade github.com/golang-jwt/jwt/v4 to 4.5.1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://github.com/golang-jwt/jwt/security/advisories/GHSA-29wx-vh33-7x7r>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-51744>
- patch: <https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c>
- other: <https://github.com/golang-jwt/jwt>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-51744>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-29wx-vh33-7x7r> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GO-2024-3250> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-51744> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-51744>
