CVE-2023-31999Fastify Oauth2
High 8.8 No auth needed
Follow: this CVE · Fastify · Fastify Oauth2 We alert you by email or Slack (account required).
- Priority
- 68
- CVSS 3.1
- 8.8
- EPSS
- 0.7% probability of exploitation in 30 days · percentile 51
- Auth required
- No
- Published
- Jul 4, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-352
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
What happens
All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all requests for all users. The purpose of the Oauth2 state parameter is to prevent Cross-Site-Request-Forgery attacks. As such, it should be unique per user and should be connected to the user's session in some way that will allow the server to validate it.
v7.2.0 changes the default behavior to store the state in a cookie with the http-only and same-site=lax attributes set. The state is now by default generated for every user. Note that this contains a breaking change in the checkStateFunction function, which now accepts the full Request object.
What to do
- Apply the vendor's security update for Oauth2.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | @fastify/oauth2 |
< 7.2.0 |
7.2.0 |
npm install @fastify/oauth2@7.2.0 |
Per OSV / GitHub Advisories (GHSA-g8x5-p9qc-cf95). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| fastify | oauth2 | < 7.2.0 |
Official sources
References
Links published by the sources. Open them with care.
- auth0.com Exploit
- github.com Release Notes
- hackerone.com Permissions Required