# CVE-2026-41213: @node-oauth/oauth2-server: PKCE code_verifier ABNF not enforced in token exchange allows brute-force redemption of intercepted authorization codes

> Attackers can brute-force PKCE code_verifiers to redeem intercepted authorization codes and gain unauthorized access.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/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:** 23 Apr 2026
- **Updated:** 25 Apr 2026
- **Also known as:** GHSA-jhm7-29pj-4xvf

## What is CVE-2026-41213?

CVE-2026-41213 is a medium-severity vulnerability in node-oauth2-server, published on 23 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@node-oauth/oauth2-server is a module for implementing an OAuth2 server in Node.js. The token exchange path accepts RFC7636-invalid code_verifier values (including one-character strings) for S256 PKCE flows. Because short/weak verifiers are accepted and failed verifier attempts do not consume the authorization code, an attacker who intercepts an authorization code can brute-force code_verifier guesses online until token issuance succeeds.

Weakness: CWE-307 (Improper Restriction of Excessive Authentication Attempts), CWE-1289 (Improper Validation of Unsafe Equivalence in Input)

## Which versions are affected by CVE-2026-41213?

2 open source packages ship an affected version, including @node-oauth/oauth2-server. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@node-oauth/oauth2-server` | npm | All versions | 5.3.0 |
| `@node-oauth/oauth2-server` | npm | All versions | 5.3.0 |

Products: Node-Oauth Node-Oauth\/Oauth2-Server.

## How do I fix CVE-2026-41213?

Upgrade @node-oauth/oauth2-server to 5.3.0 or later.

## Is CVE-2026-41213 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41213 and fix it if it is affected.

What it is: CVE-2026-41213 is a medium-severity vulnerability in node-oauth2-server, published on 23 Apr 2026. 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-2026-41213 exists.

Affected packages and fixed versions:
- @node-oauth/oauth2-server (npm): affected all versions; fixed in 5.3.0
- @node-oauth/oauth2-server (npm): affected all versions; fixed in 5.3.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-2026-41213/ (Markdown: https://insights.sbomify.com/CVE-2026-41213/index.md)
```

## Sources

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

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