# Swagger UI reverse tabnapping in anchor tags

Source: https://junglewise.ai/threats/swagger-ui-reverse-tabnapping-in-anchor-tags-652c76c5  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-06-20. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2019-06-20

Swagger UI is a widely-used API documentation tool. In versions before 3.18.0, the tool improperly used HTML anchor tags with target="_blank", which can allow attackers to manipulate the original page when users click on external links. This weakness is commonly exploited for phishing attacks where victims are redirected to malicious pages that appear to be the original site.

Technologies: [swagger-ui (npm)](https://junglewise.ai/threats/technologies/swagger-ui). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 20 June 2019.

**Which products and versions are affected?** swagger-ui (npm) SEMVER:introduced=0,fixed=3.18.0.

**Is there a fix for This vulnerability?** Yes. swagger-ui (npm): upgrade to 3.18.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run swagger-ui (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- swagger-ui (npm): upgrade to 3.18.0 or later

  ```sh
  npm install swagger-ui@3.18.0
  ```


## Technical details

The vulnerability is a reverse tabnapping flaw (CWE-1022) in Swagger UI's anchor tag implementation. When anchor tags open links in new tabs/windows using target="_blank" without rel="noopener noreferrer" attributes, the newly opened page gains access to the window.opener property of the original page, allowing attackers to redirect users back to a phishing site. The flaw requires user interaction (clicking a link) but has a network attack vector since the malicious link can be hosted externally. The fix, released in version 3.18.0, replaces unsafe anchor tags with proper Link components that include the necessary security attributes.

## Affected products

- Swagger API Swagger UI prior to 3.18.0

## Timeline

- 2019-06-20: disclosed
- 2019-06-20: patched: Fix released in version 3.18.0

## References

- [https://github.com/swagger-api/swagger-ui/pull/4789](https://github.com/swagger-api/swagger-ui/pull/4789)
- [https://github.com/swagger-api/swagger-ui/commit/3f4cae3334fdd492a373f4453bd03a9ebd87becf](https://github.com/swagger-api/swagger-ui/commit/3f4cae3334fdd492a373f4453bd03a9ebd87becf)

## Related threats

- [swagger-ui cross-site scripting in key names](https://junglewise.ai/threats/cve-2016-1000229-swagger-ui-cross-site-scripting-in-key-names)
- [Swagger UI spoofing attack via URL parameter](https://junglewise.ai/threats/cve-2018-25031-swagger-ui-spoofing-attack-via-url-parameter)
- [Swagger UI phishing vector via URL parameter](https://junglewise.ai/threats/swagger-ui-phishing-vector-via-url-parameter-8eeaa776)
- [Swagger UI Cross-Site Scripting in apiInfo.description](https://junglewise.ai/threats/swagger-ui-cross-site-scripting-in-apiinfo-description-6b3f2dbe)
- [Swagger Swagger UI Cross-Site Scripting in API response rendering](https://junglewise.ai/threats/swagger-swagger-ui-cross-site-scripting-in-api-response-rendering-be1bf724)
