# CVE-2016-10555: Forgeable Public/Private Tokens in jwt-simple

> Attackers can forge JWT tokens by exploiting algorithm confusion in jwt-simple, bypassing authentication and modifying data.

- **Severity:** Medium 6.5 (`CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 May 2018
- **Updated:** 16 Sep 2024
- **Also known as:** GHSA-vgrx-w6rg-8fqf

## What is CVE-2016-10555?

CVE-2016-10555 is a medium-severity vulnerability in HackerOne jwt-simple node module, published on 31 May 2018. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Since "algorithm" isn't enforced in jwt.decode()in jwt-simple 0.3.0 and earlier, a malicious user could choose what algorithm is sent sent to the server. If the server is expecting RSA but is sent HMAC-SHA with RSA's public key, the server will think the public key is actually an HMAC private key. This could be used to forge any data an attacker wants.

Weakness: CWE-310, CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2016-10555?

2 open source packages ship an affected version, including jwt-simple. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jwt-simple` | npm | All versions | 0.3.1 |
| `jwt-simple` | npm | All versions | 0.3.1 |

Products: Jwt-Simple Project Jwt-Simple.

## How do I fix CVE-2016-10555?

Upgrade jwt-simple to 0.3.1 or later.

## Is CVE-2016-10555 being exploited?

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

Public exploit code:

- 针对JWT渗透开发的漏洞验证/密钥爆破工具，针对CVE-2015-9235/空白密钥/未验证签名攻击/CVE-2016-10555/CVE-2018-0114/CVE-2020-28042的结果生成用于FUZZ，也可使用字典/字符枚举(包括JJWT)的方式进行爆破(JWT Crack) (github_poc): https://github.com/z-bool/Venom-JWT
- Change the algorithm RS256(asymmetric) to HS256(symmetric) - POC (CVE-2016-10555) (github_poc): https://github.com/CircuitSoul/poc-cve-2016-10555
- CVE-2016-10555 PoC code (github_poc): https://github.com/scent2d/PoC-CVE-2016-10555

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-10555 and fix it if it is affected.

What it is: CVE-2016-10555 is a medium-severity vulnerability in HackerOne jwt-simple node module, published on 31 May 2018. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2016-10555 in the wild and no public exploit code.

Affected packages and fixed versions:
- jwt-simple (npm): affected all versions; fixed in 0.3.1
- jwt-simple (npm): affected all versions; fixed in 0.3.1

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-2016-10555/ (Markdown: https://insights.sbomify.com/CVE-2016-10555/index.md)
```

## Sources

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

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