Cross-site request forgery in npm @fastify/oauth2
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-352.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| npm | @fastify/oauth2 | v7.2.0 to before v7.2.0 | v7.2.0 | Patch available | CNA |
| — | @fastify/oauth2 (npm) | before 7.2.0 | 7.2.0 | Patch available | GHSA-g8x5-p9qc-cf95 |
- @fastify/oauth2 Vendornpm Affected v7.2.0 to before v7.2.0 Fixed in v7.2.0 Patch available CNA
- @fastify/oauth2 (npm) Vendor— Affected before 7.2.0 Fixed in 7.2.0 Patch available GHSA-g8x5-p9qc-cf95
Remediation
- Fix · CNA @fastify/oauth2 (npm) Fixed in v7.2.0
- Fix · GHSA-g8x5-p9qc-cf95 @fastify/oauth2 (npm) Fixed in 7.2.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat OpenShift Dev Spaces | Affected | No fix yet |
Timeline
- 2026-10-02 Threatist record created from CVE-2023-31999
- 2026-10-03 Alias added: GHSA-g8x5-p9qc-cf95
References
Other 5
- https://hackerone.com/reports/2020418
- https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0
- https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95
- https://github.com/fastify/fastify-oauth2/commit/bff756b456cbb769080631af2beb85671ff4c79c
- https://github.com/fastify/fastify-oauth2
Sources
- CVE-2023-31999 · CVE Program
- CVE-2023-31999 · NVD
- FIRST EPSS
- GHSA-g8x5-p9qc-cf95 · GitHub Advisory Database · CC BY 4.0
- CVE-2023-31999 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences