# CVE-2024-29901: @workos-inc/authkit-nextjs session replay vulnerability

> Attackers can reuse expired sessions by manipulating headers, allowing unauthorized access to user accounts in Next.js applications using AuthKit.

- **Severity:** Medium 4.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/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:** 29 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-35w3-6qhc-474v

## What is CVE-2024-29901?

CVE-2024-29901 is a medium-severity authentication bypass vulnerability in workos authkit-nextjs, published on 29 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The AuthKit library for Next.js provides helpers for authentication and session management using WorkOS & AuthKit with Next.js.
A user can reuse an expired session by controlling the `x-workos-session` header. The vulnerability is patched in v0.4.2.

Weakness: CWE-294 (Authentication Bypass by Capture-replay)

## Which versions are affected by CVE-2024-29901?

2 open source packages ship an affected version, including @workos-inc/authkit-nextjs. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@workos-inc/authkit-nextjs` | npm | All versions | 0.4.2 |
| `@workos-inc/authkit-nextjs` | npm | All versions | 0.4.2 |

Products: Workos Authkit-Nextjs.

## How do I fix CVE-2024-29901?

Upgrade @workos-inc/authkit-nextjs to 0.4.2 or later.

## Is CVE-2024-29901 being exploited?

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

## Other vulnerabilities in workos authkit-nextjs

- [CVE-2025-64762](https://insights.sbomify.com/CVE-2025-64762/): authkit-nextjs may let session cookies be cached in CDNs (high 8.0)
- [CVE-2024-51752](https://insights.sbomify.com/CVE-2024-51752/): Refresh tokens are logged when the debug flag is enabled in @workos-inc/authkit-nextjs (low 2.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-29901 and fix it if it is affected.

What it is: CVE-2024-29901 is a medium-severity authentication bypass vulnerability in workos authkit-nextjs, published on 29 Mar 2024. 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-2024-29901 in the wild and no public exploit code.

Affected packages and fixed versions:
- @workos-inc/authkit-nextjs (npm): affected all versions; fixed in 0.4.2
- @workos-inc/authkit-nextjs (npm): affected all versions; fixed in 0.4.2

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

## Sources

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

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