CVEfocus › CVE database › CVE-2024-51744

CVE-2024-51744Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous…

CVSS 3.1 LowEPSS 0.6% (higher than 46% of CVEs)Published 2024-11-04Updated 2024-11-05Assigner: GitHub_M

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.

CWE-755

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

3Fixed
32Fix pending
5Under investigation
2Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10golang-github-golang-jwt-jwtFix pendingUBUNTU-CVE-2024-51744
Ubuntu 26.10golang-github-golang-jwt-jwt-v5Fix pendingUBUNTU-CVE-2024-51744
Ubuntu 26.04golang-github-golang-jwt-jwtUnder investigationUBUNTU-CVE-2024-51744
Ubuntu 26.04golang-github-golang-jwt-jwt-v5Under investigationUBUNTU-CVE-2024-51744
Ubuntu 25.10golang-github-golang-jwt-jwtWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2024-51744
Ubuntu 25.10golang-github-golang-jwt-jwt-v5Will not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2024-51744
Ubuntu 24.04golang-github-golang-jwt-jwtUnder investigationUBUNTU-CVE-2024-51744
Ubuntu 24.04golang-github-golang-jwt-jwt-v5Under investigationUBUNTU-CVE-2024-51744
Ubuntu 22.04golang-github-golang-jwt-jwtUnder investigationUBUNTU-CVE-2024-51744
Debian 14golang-github-golang-jwt-jwtFixed5.0.0+really4.5.2-1DEBIAN-CVE-2024-51744
Debian 13golang-github-golang-jwt-jwtFixed5.0.0+really4.5.2-1DEBIAN-CVE-2024-51744
Debian 12golang-github-golang-jwt-jwtFix pendingDEBIAN-CVE-2024-51744
Red Hat Enterprise Linux 10grafanaFix pending
Fix deferred
Red Hat Enterprise Linux 10grafana-selinuxFix pending
Fix deferred
Red Hat Enterprise Linux 10osbuild-composerFix pending
Fix deferred
Red Hat Enterprise Linux 10osbuild-composer-coreFix pending
Fix deferred
Red Hat Enterprise Linux 10osbuild-composer-workerFix pending
Fix deferred
Red Hat Enterprise Linux 9grafanaFix pending
Fix deferred
Red Hat Enterprise Linux 9grafana-selinuxFix pending
Fix deferred
Red Hat Enterprise Linux 9osbuild-composerFix pending
Fix deferred
Red Hat Enterprise Linux 9osbuild-composer-coreFix pending
Fix deferred
Red Hat Enterprise Linux 9osbuild-composer-dnf-jsonFix pending
Fix deferred
Red Hat Enterprise Linux 9osbuild-composer-workerFix pending
Fix deferred
Red Hat Enterprise Linux 8grafanaFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-azure-monitorFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-cloudwatchFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-elasticsearchFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-graphiteFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-influxdbFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-lokiFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-mssqlFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-mysqlFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-opentsdbFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-postgresFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-prometheusFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-selinuxFix pending
Fix deferred
Red Hat Enterprise Linux 8grafana-stackdriverFix pending
Fix deferred
Red Hat Enterprise Linux 8osbuild-composerFix pending
Fix deferred
Red Hat Enterprise Linux 8osbuild-composer-coreFix pending
Fix deferred
Red Hat Enterprise Linux 8osbuild-composer-dnf-jsonFix pending
Fix deferred
Red Hat Enterprise Linux 8osbuild-composer-workerFix pending
Fix deferred
Go librarygithub.com/golang-jwt/jwt/v4Fixed4.5.1GHSA-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.

References

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.