CVE-2026-18165

Source
https://cve.org/CVERecord?id=CVE-2026-18165
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-18165.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-18165
Aliases
  • GHSA-p8h8-rj28-m8q9
Published
2026-08-15T13:45:51Z
Modified
2026-09-06T03:45:48Z
Severity
  • 4.2 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N CVSS Calculator
Summary
@fastify/oauth2 vulnerable to Login CSRF via plantable OAuth state cookies
Details

@fastify/oauth2 is an OAuth 2.0 plugin for Fastify. In versions from 7.2.0 up to but not including 8.3.0, the plugin validates the OAuth state, and with PKCE the 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. Any party able to write a cookie for the application's host, such as a sibling subdomain under the same registrable domain, can plant matching state and verifier cookies and complete an attacker-owned OAuth flow inside a victim's browser, silently signing the victim in to the attacker's account (login CSRF). It does not expose the victim's own account, credentials, or tokens. The issue is fixed in @fastify/oauth2 8.3.0, which adds an opt-in hostPrefixedCookies option. Users should upgrade to 8.3.0 and enable it, or bind state to a server-side session.

Database specific
{
    "cna_assigner": "openjs",
    "cwe_ids": [
        "CWE-352"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/18xxx/CVE-2026-18165.json"
}
References

Affected packages

Git / github.com/fastify/fastify-oauth2

Affected ranges

Type
GIT
Repo
https://github.com/fastify/fastify-oauth2
Events
Database specific
Show details
{
    "cpe": "cpe:2.3:a:fastify:fastify\\/oauth2:*:*:*:*:*:node.js:*:*",
    "extracted_events": [
        {
            "introduced": "7.2.0"
        },
        {
            "fixed": "8.3.0"
        }
    ],
    "source": [
        "AFFECTED_FIELD",
        "CPE_RANGE"
    ]
}

Affected versions

v7.*
v7.2.0
v7.2.1
v7.2.2
v7.3.0
v7.4.0
v7.5.0
v7.6.0
v7.7.0
v7.8.0
v7.8.1
v7.9.0
v8.*
v8.0.0
v8.0.1
v8.1.0
v8.1.1
v8.1.2
v8.2.0
v8.2.1

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-18165.json"