GHSA-x9p2-fxq6-2m5f: Swagger ui Reverse Tabnapping Vulnerability

MODERATE
CVSS 4.3
CWE-1022
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-x9p2-fxq6-2m5f
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-1022: Use of Web Link to Untrusted Target with window.opener Access
Affected Product Swagger ui
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (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.

swagger-ui fixed: 3.18.0
npm install swagger-ui@3.18.0
Verify Direct and Transitive Dependencies

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

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. ## Recommendation Upgrade to version 3.18.0 or later.

GHSA-x9p2-fxq6-2m5f Affected Swagger ui Versions

1 component(s)
Fixed Versions:
3.18.0
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?
GHSA-x9p2-fxq6-2m5f is a security vulnerability in Swagger ui involving Reverse Tabnapping in swagger-ui under CWE-1022: Use of Web Link to Untrusted Target with window.opener Access.
Which Swagger ui versions are affected?
Affected versions include releases prior to 3.18.0 across affected packages: swagger-ui.
What version fixes GHSA-x9p2-fxq6-2m5f?
Upgrading to 3.18.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is swagger-ui affected?
Yes, swagger-ui is affected in releases prior to 3.18.0. Upgrade your dependency to 3.18.0 or later.
What is the CVSS score of GHSA-x9p2-fxq6-2m5f?
GHSA-x9p2-fxq6-2m5f has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-x9p2-fxq6-2m5f?
GHSA-x9p2-fxq6-2m5f is classified under CWE-1022: Use of Web Link to Untrusted Target with window.opener Access (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.).
How can I check npm dependencies for GHSA-x9p2-fxq6-2m5f?
Run the dependency tree command: 'npm ls swagger-ui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}