CVE-2020-26160: Authorization bypass in github.com/dgrijalva/jwt-go

github.com/dgrijalva/jwt-go Updated 02 Oct 2025

Summary

14/04/2021
No i
High
7.5

CVE-2020-26160: Authorization bypass in github.com/dgrijalva/jwt-go. Affects github.com/dgrijalva/jwt-go versions >= 0.0.0-20150717181359-44718f8a89b0. No fix is published. How to fix ↓

Also tracked for

The same CVE-2020-26160 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package github.com/dgrijalva/jwt-go is a Go implementation of JSON Web Tokens (JWT). It provides functionality for creating, signing, and verifying JWTs. JWTs are used for securely transmitting information between parties as a JSON object. This package is widely used in Go applications for implementing authentication and authorization mechanisms.

Vulnerability Detail

The vulnerability (CVE-2020-26160) in github.com/dgrijalva/jwt-go allows an attacker to bypass authorization checks if a JWT contains an audience claim with an array of strings instead of a single string. When the MapClaims.VerifyAudience function is called with the 'req' parameter set to false, the audience verification is bypassed, allowing an invalid set of audiences to be provided. This can lead to unauthorized access and privilege escalation in affected applications.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to apply the fix by upgrading to the latest version of the package.

Conclusion

The vulnerability (CVE-2020-26160) in github.com/dgrijalva/jwt-go allows for authorization bypass, potentially leading to unauthorized access and privilege escalation. It is recommended to upgrade to version 4.0.0-preview1 of github.com/dgrijalva/jwt-go/v4 to fix this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for github.com/dgrijalva/jwt-go →

Share this vulnerability

FAQ

This vulnerability allows an attacker to bypass authorization checks, potentially leading to unauthorized access and privilege escalation in affected applications.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It analyzes your Gopkg.lock file and alerts you in real-time for open-source vulnerabilities.

Yes, the vulnerability has been fixed in version 4.0.0-preview1 of github.com/dgrijalva/jwt-go/v4. It is recommended to upgrade to this version to mitigate the vulnerability.

There are no known workarounds for this vulnerability. It is recommended to apply the fix by upgrading to the latest version of the package.

You can find more information about this vulnerability in the CVE-2020-26160 entry on the VulnDB database (https://vuln.go.dev/ID/GO-2020-0017.json).

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback