# CVE-2024-51752: Refresh tokens are logged when the debug flag is enabled in @workos-inc/authkit-nextjs

> Attackers can obtain refresh tokens if the debug flag is enabled, potentially leading to session hijacking.

- **Severity:** Low 2.1 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Nov 2024
- **Updated:** 5 Nov 2024
- **Also known as:** GHSA-5wmg-9cvh-qw25

## What is CVE-2024-51752?

CVE-2024-51752 is a low-severity vulnerability in workos authkit-nextjs, published on 5 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The AuthKit library for Next.js provides convenient helpers for authentication and session management using WorkOS & AuthKit with Next.js. In affected versions refresh tokens are logged to the console when the disabled by default `debug` flag, is enabled. This issue has been patched in version 0.13.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-532 (Insertion of Sensitive Information into Log File)

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

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.13.2 |
| `@workos-inc/authkit-nextjs` | npm | All versions | 0.13.2 |

Products: Workos Authkit-Nextjs.

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

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

## Is CVE-2024-51752 being exploited?

There is no known exploitation of CVE-2024-51752 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-29901](https://insights.sbomify.com/CVE-2024-29901/): @workos-inc/authkit-nextjs session replay vulnerability (medium 4.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-51752 is a low-severity vulnerability in workos authkit-nextjs, published on 5 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-51752 in the wild and no public exploit code.

Affected packages and fixed versions:
- @workos-inc/authkit-nextjs (npm): affected all versions; fixed in 0.13.2
- @workos-inc/authkit-nextjs (npm): affected all versions; fixed in 0.13.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-51752/ (Markdown: https://insights.sbomify.com/CVE-2024-51752/index.md)
```

## Sources

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

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