# CVE-2018-0114: Cisco node-jose improper validation of JWT signature

> An attacker can forge valid JSON Web Signatures by embedding their own public key in the token header, bypassing signature verification.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Jan 2018
- **Updated:** 2 Dec 2024
- **Also known as:** GHSA-jfxm-w8g2-4rcv

## What is CVE-2018-0114?

CVE-2018-0114 is a high-severity vulnerability in Node-jose Library, published on 4 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A vulnerability in the Cisco node-jose open source library before 0.11.0 could allow an unauthenticated, remote attacker to re-sign tokens using a key that is embedded within the token. The vulnerability is due to node-jose following the JSON Web Signature (JWS) standard for JSON Web Tokens (JWTs). This standard specifies that a JSON Web Key (JWK) representing a public key can be embedded within the header of a JWS. This public key is then trusted for verification. An attacker could exploit this by forging valid JWS objects by removing the original signature, adding a new public key to the header, and then signing the object using the (attacker-owned) private key associated with the public key embedded in that JWS header.

Weakness: CWE-347 (Improper Verification of Cryptographic Signature)

## Which versions are affected by CVE-2018-0114?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `node-jose` | npm | All versions | 0.11.0 |
| `node-jose` | npm | All versions | 0.11.0 |

Products: Cisco Node-Jose.

## How do I fix CVE-2018-0114?

Upgrade node-jose to 0.11.0 or later.

## Is CVE-2018-0114 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-0114 exists.

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
- This repository contains the POC of an exploit for node-jose < 0.11.0 (github_poc): https://github.com/zi0Black/POC-CVE-2018-0114
- Exploitation of a vulnerability in Cisco's node-jose, a JavaScript library created to manage JWT. (github_poc): https://github.com/j4k0m/CVE-2018-0114
- Exploit  for Node-jose < 0.11.0 written in Ruby (github_poc): https://github.com/scumdestroy/CVE-2018-0114
- python2.7 script for JWT generation (github_poc): https://github.com/Eremiel/CVE-2018-0114
- POC for CVE-2018-0114 written in Go (github_poc): https://github.com/adityathebe/POC-CVE-2018-0114

## Other vulnerabilities in Node-jose Library

- [CVE-2023-25653](https://insights.sbomify.com/CVE-2023-25653/): Improper calculations in ECC implementation can trigger a Denial-of-Service (DoS) (high 7.5)
- [CVE-2017-16007](https://insights.sbomify.com/CVE-2017-16007/): Invalid Curve Attack in node-jose (medium 5.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-0114 and fix it if it is affected.

What it is: CVE-2018-0114 is a high-severity vulnerability in Node-jose Library, published on 4 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-0114 exists.

Affected packages and fixed versions:
- node-jose (npm): affected all versions; fixed in 0.11.0
- node-jose (npm): affected all versions; fixed in 0.11.0

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

## Sources

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

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