CVSS 3.1
5.4 mediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NMedium (5.4) in fastify fastify\/oauth2. EPSS 0.1% estimated probability of exploitation activity in the next 30 days.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NExplain CVE-2026-18165 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-18165?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-18165?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-18165 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.
From the CNA's record in the CVE List.
| Product | Affected |
|---|---|
| @fastify/oauth2 | from 7.2.0 before 8.3.0 |
Red Hat rates this Low.
A login CSRF vulnerability was found in @fastify/oauth2, an OAuth 2.0 plugin for the Fastify web framework. In versions 7.2.0 through 8.2.0, the plugin validates the OAuth state parameter and PKCE code verifier by comparing the callback query parameter against an unprefixed, predictable cookie, with no server-side binding to the browser that began the flow. An attacker able to write a cookie for the application's host, such as through control of a sibling subdomain under the same registrable domain or via cross-site scripting on a sibling subdomain, can plant matching state and verifier cookies and complete an attacker-owned OAuth flow inside a victim's browser. This allows the attacker to silently sign the victim into the attacker's account (login CSRF), enabling the attacker to harvest any data or activity the victim performs while unknowingly using the attacker's account. This issue affects Red Hat OpenShift Dev Spaces versions 3.27 through 3.30, which bundle the vulnerable @fastify/oauth2 version 8.2.0.
This issue is fixed in @fastify/oauth2 version 8.3.0. Red Hat will provide updated versions of OpenShift Dev Spaces that include the fixed library version.
Until updates are available, administrators can reduce the risk of login CSRF attacks by implementing the following mitigations:
1. Isolate OpenShift Dev Spaces instances on dedicated domains or subdomains that do not share registrable domains with untrusted applications or user-controlled content.
2. If server-side session management is available, bind OAuth state parameters to server-side sessions rather than relying solely on cookie-based state validation.
3. Monitor for suspicious OAuth flows, particularly cases where users appear to be signed into unexpected accounts or workspaces they did not create.
4. Educate developers about the risks of using OAuth login links from untrusted sources, and encourage verification of account identity after OAuth login completes.
5. When upgrading to @fastify/oauth2 8.3.0 or later, enable the hostPrefixedCookies option to prevent cross-subdomain cookie planting attacks.
Note that this vulnerability requires the attacker to control a sibling subdomain or exploit a cross-site scripting vulnerability on a sibling subdomain, which significantly raises the attack complexity in most deployment scenarios.
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat OpenShift Dev Spaces | devspaces/dashboard-rhel9 | Fix deferred |
Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-18165.
The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.