GHSA-x9p2-fxq6-2m5f: Swagger ui Reverse Tabnapping Vulnerability
MODERATEGHSA-x9p2-fxq6-2m5f is a MODERATE (CVSS 4.3) reverse tabnapping vulnerability (CWE-1022: Use of Web Link to Untrusted Target with window.opener Access) affecting Swagger ui libraries in the npm ecosystem. The issue involves reverse tabnapping in swagger-ui. Remediation is available by upgrading affected packages to version 3.18.0.
GHSA-x9p2-fxq6-2m5f at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N).
How to Fix GHSA-x9p2-fxq6-2m5f
To remediate this vulnerability, upgrade all affected Swagger ui 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 swagger-ui@3.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls swagger-ui
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-x9p2-fxq6-2m5f, inspect your project dependencies using npm:
npm ls swagger-ui
Analyze the terminal output to locate any version of Swagger ui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.18.0), your application is affected.
Note: The npm ls swagger-ui 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-1022: Use of Web Link to Untrusted Target with window.opener Access, where the web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property. In Swagger ui, 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
GHSA-x9p2-fxq6-2m5f Affected Swagger ui Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
swagger-ui
|
npm |
< 3.18.0
|
3.18.0
|
References
Frequently Asked Questions
What is GHSA-x9p2-fxq6-2m5f?
Which Swagger ui versions are affected?
What version fixes GHSA-x9p2-fxq6-2m5f?
Is swagger-ui affected?
What is the CVSS score of GHSA-x9p2-fxq6-2m5f?
What CWE is associated with GHSA-x9p2-fxq6-2m5f?
How can I check npm dependencies for GHSA-x9p2-fxq6-2m5f?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x9p2-fxq6-2m5f",
"modified" : "2021-08-16T23:44:47Z",
"published" : "2019-06-20T14:33:07Z",
"aliases" : [ ],
"summary" : "Reverse Tabnapping in swagger-ui",
"details" : "Versions of `swagger-ui` prior to 3.18.0 are vulnerable to [Reverse Tabnapping](https://www.owasp.org/index.php/Reverse_Tabnabbing). The package uses `target='_blank'` in anchor tags, allowing attackers to access `window.opener` for the original page. This is commonly used for phishing attacks.\n\n\n## Recommendation\n\nUpgrade to version 3.18.0 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/pull/4789"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/commit/3f4cae3334fdd492a373f4453bd03a9ebd87becf"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/releases/tag/v3.18.0"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-SWAGGERUI-449808"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/975"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1022" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2019-06-20T14:13:56Z",
"nvd_published_at" : null
}
}