CVE-2022-0087: @keystone 6/auth Cross-Site Scripting Vulnerability
HIGHCVE-2022-0087 is a HIGH (CVSS 7.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @keystone 6/auth libraries in the npm ecosystem. The issue involves reflected cross-site scripting (xss) vulnerability. Remediation is available by upgrading affected packages to version 1.0.2.
CVE-2022-0087 at a Glance
Security Impact
CVSS: 7.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2022-0087
To remediate this vulnerability, upgrade all affected @keystone 6/auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @keystone-6/auth@1.0.2
npm install @keystone-next/auth@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @keystone-6/auth
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-0087, inspect your project dependencies using npm:
npm ls @keystone-6/auth
Analyze the terminal output to locate any version of @keystone 6/auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2), your application is affected.
Note: The npm ls @keystone-6/auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @keystone 6/auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-0087 Affected @keystone 6/auth Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@keystone-6/auth
|
npm |
< 1.0.2
|
1.0.2
|
|
@keystone-next/auth
|
npm |
≤ 37.0.0
|
|
References
Frequently Asked Questions
What is CVE-2022-0087?
Which @keystone 6/auth versions are affected?
What version fixes CVE-2022-0087?
Is @keystone-6/auth affected?
Is @keystone-next/auth affected?
What is the CVSS score of CVE-2022-0087?
What CWE is associated with CVE-2022-0087?
How can I check npm dependencies for CVE-2022-0087?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hrgx-7j6v-xj82",
"modified" : "2022-01-19T17:42:16Z",
"published" : "2022-01-12T21:55:40Z",
"aliases" : [ "CVE-2022-0087" ],
"summary" : "Reflected cross-site scripting (XSS) vulnerability",
"details" : "This security advisory relates to a capability for an attacker to exploit a reflected cross-site scripting vulnerability when using the `@keystone-6/auth` package.\n\n#### Impact\nThe vulnerability can impact users of the administration user interface when following an untrusted link to the `signin` or `init` page.\nThis is a targeted attack and may present itself in the form of phishing and or chained in conjunction with some other vulnerability.\n\n## Vulnerability mitigation\nPlease upgrade to `@keystone-6/auth >= 1.0.2`, where this vulnerability has been closed.\nIf you are using `@keystone-next/auth`, we **strongly** recommend you upgrade to `@keystone-6`.\n\n### Workarounds\nIf for some reason you cannot upgrade the dependencies in software, you could alternatively\n\n- disable the administration user interface, or \n- if using a reverse-proxy, strip query parameters when accessing the administration interface\n\n### References\nhttps://owasp.org/www-community/attacks/xss/\n\nThanks to Shivansh Khari (@Shivansh-Khari) for discovering and reporting this vulnerability",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@keystone-6/auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@keystone-next/auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "37.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/keystonejs/keystone/security/advisories/GHSA-hrgx-7j6v-xj82"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0087"
}, {
"type" : "WEB",
"url" : "https://github.com/keystonejs/keystone/commit/96bf833a23b1a0a5d365cf394467a943cc481b38"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/keystonejs/keystone"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/c9d7374f-2cb9-4bac-9c90-a965942f413e"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-10T21:45:34Z",
"nvd_published_at" : "2022-01-12T00:15:00Z"
}
}