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

> Attackers can bypass access restrictions in jwt-go by exploiting audience claim type assertion failures, allowing unauthorized access to services.

- **Severity:** High 7.5 (`CVSS:3.1/AC:L/AV:N/A:N/C:H/I:N/PR:N/S:U/UI:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Sep 2020
- **Updated:** 4 Aug 2024
- **Also known as:** AZL-41684, CLEANSTART-2025-CI95096, DEBIAN-CVE-2020-26160, GHSA-w73w-5m7g-f7qc, GO-2020-0017, SNYK-GOLANG-GITHUBCOMDGRIJALVAJWTGO-596515, UBUNTU-CVE-2020-26160, openSUSE-SU-2024:11428-1, openSUSE-SU-2024:11668-1

## What is CVE-2020-26160?

CVE-2020-26160 is a high-severity authentication bypass vulnerability in n/a, published on 30 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

jwt-go before 4.0.0-preview1 allows attackers to bypass intended access restrictions in situations with []string{} for m["aud"] (which is allowed by the specification). Because the type assertion fails, "" is the value of aud. This is a security problem if the JWT token is presented to a service that lacks its own audience check.

Weakness: CWE-755 (Improper Handling of Exceptional Conditions), CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2020-26160?

6 open source packages ship an affected version, including github.com/dgrijalva/jwt-go and github.com/dgrijalva/jwt-go/v4. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/dgrijalva/jwt-go` | Go | From 0.0.0-20150717181359-44718f8a89b0 | None |
| `github.com/dgrijalva/jwt-go` | Go | From 0.0.0-20150717181359-44718f8a89b0 to 3.2.0 | None |
| `github.com/dgrijalva/jwt-go` | Go | From 0.0.0-20150717181359-44718f8a89b0 to 3.2.0 | None |
| `github.com/dgrijalva/jwt-go/v4` | Go | All versions | 4.0.0-preview1 |
| `github.com/dgrijalva/jwt-go/v4` | Go | All versions | 4.0.0-preview1 |
| `github.com/dgrijalva/jwt-go/v4` | Go | All versions | 4.0.0-preview1 |
| `telegraf` | openSUSE:Tumbleweed | All versions | 1.19.0-1.2 |
| `velero-plugin-for-microsoft-azure` | openSUSE:Tumbleweed | All versions | 1.3.1-1.1 |

Products: Jwt-Go Project Jwt-Go.

## How do I fix CVE-2020-26160?

Upgrade to a fixed version.

## Is CVE-2020-26160 being exploited?

There is no known exploitation of CVE-2020-26160 in the wild and no public exploit code.

Public exploit code:

- AURORA demo target — deliberately vulnerable lockfiles (CVE-2019-10744, CVE-2018-18074, CVE-2020-26160) (github_poc): https://github.com/mlbrilliance/aurora-demo-lockfile

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-26160 and fix it if it is affected.

What it is: CVE-2020-26160 is a high-severity authentication bypass vulnerability in n/a, published on 30 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-26160 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/dgrijalva/jwt-go (Go): affected from 0.0.0-20150717181359-44718f8a89b0; no fix listed
- github.com/dgrijalva/jwt-go (Go): affected from 0.0.0-20150717181359-44718f8a89b0 up to 3.2.0; no fix listed
- github.com/dgrijalva/jwt-go (Go): affected from 0.0.0-20150717181359-44718f8a89b0 up to 3.2.0; no fix listed
- github.com/dgrijalva/jwt-go/v4 (Go): affected all versions; fixed in 4.0.0-preview1
- github.com/dgrijalva/jwt-go/v4 (Go): affected all versions; fixed in 4.0.0-preview1
- github.com/dgrijalva/jwt-go/v4 (Go): affected all versions; fixed in 4.0.0-preview1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-26160/ (Markdown: https://insights.sbomify.com/CVE-2020-26160/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-26160
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-26160
- OSV: https://osv.dev/vulnerability/CVE-2020-26160

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-26160/
Summaries are generated and may contain mistakes; the official description above is the record.
