CVE-2024-51744Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous…
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.
What to do
Fixed builds are available from Debian, Go: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-github-golang-jwt-jwt | Fix pending | UBUNTU-CVE-2024-51744 | |
| Ubuntu 26.10 | golang-github-golang-jwt-jwt-v5 | Fix pending | UBUNTU-CVE-2024-51744 | |
| Ubuntu 26.04 | golang-github-golang-jwt-jwt | Under investigation | UBUNTU-CVE-2024-51744 | |
| Ubuntu 26.04 | golang-github-golang-jwt-jwt-v5 | Under investigation | UBUNTU-CVE-2024-51744 | |
| Ubuntu 25.10 | golang-github-golang-jwt-jwt | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-51744 | |
| Ubuntu 25.10 | golang-github-golang-jwt-jwt-v5 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-51744 | |
| Ubuntu 24.04 | golang-github-golang-jwt-jwt | Under investigation | UBUNTU-CVE-2024-51744 | |
| Ubuntu 24.04 | golang-github-golang-jwt-jwt-v5 | Under investigation | UBUNTU-CVE-2024-51744 | |
| Ubuntu 22.04 | golang-github-golang-jwt-jwt | Under investigation | UBUNTU-CVE-2024-51744 | |
| Debian 14 | golang-github-golang-jwt-jwt | Fixed | 5.0.0+really4.5.2-1 | DEBIAN-CVE-2024-51744 |
| Debian 13 | golang-github-golang-jwt-jwt | Fixed | 5.0.0+really4.5.2-1 | DEBIAN-CVE-2024-51744 |
| Debian 12 | golang-github-golang-jwt-jwt | Fix pending | DEBIAN-CVE-2024-51744 | |
| Red Hat Enterprise Linux 10 | grafana | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | grafana-selinux | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | osbuild-composer | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | osbuild-composer-core | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 10 | osbuild-composer-worker | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | grafana | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | grafana-selinux | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | osbuild-composer | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-core | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-dnf-json | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-worker | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-azure-monitor | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-cloudwatch | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-elasticsearch | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-graphite | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-influxdb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-loki | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-mssql | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-mysql | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-opentsdb | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-postgres | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-prometheus | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-selinux | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | grafana-stackdriver | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | osbuild-composer | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-core | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-dnf-json | Fix pending Fix deferred | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-worker | Fix pending Fix deferred | ||
| Go library | github.com/golang-jwt/jwt/v4 | Fixed | 4.5.1 | GHSA-29wx-vh33-7x7r |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- golang-jwt jwt: affected: < 4.5.1
References
- https://github.com/golang-jwt/jwt/security/advisories/GHSA-29wx-vh33-7x7r
- https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.