# CVE-2016-1000233: Swagger UI cross-site scripting via url parameter

Source: https://junglewise.ai/threats/cve-2016-1000233-swagger-ui-cross-site-scripting-via-url-parameter  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2016-1000233 · Severity: info · CVSS 0 · Published 2020-09-01

Swagger UI is a popular web-based API documentation tool. The vulnerability allows attackers to inject and execute malicious JavaScript in users' browsers by crafting a malicious link with a specially crafted URL parameter that references an attacker-controlled server. When a user clicks the link, the attacker's script executes with the same privileges as the user, potentially compromising API credentials, session tokens, or sensitive data visible in the documentation.

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

## Quick answers

**Is CVE-2016-1000233 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-1000233 being exploited in the wild.

**How severe is CVE-2016-1000233?** Informational severity, with a CVSS score of 0, published 1 September 2020.

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

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

**How is CVE-2016-1000233 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2016-1000233?** 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 2.2.1 or later

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


## Technical details

This is a cross-site scripting (XSS) vulnerability (CWE-79) in Swagger UI versions prior to 2.2.1. The root cause is that Swagger UI automatically executes external JavaScript loaded via the "url" query string parameter when the response includes a Content-Type: application/javascript header, without proper sanitization. An attacker can set up a malicious server returning JavaScript with the correct content-type header, then craft a Swagger UI URL embedding that server's address in the url parameter. When a victim visits the malicious link, the attacker's script executes in their browser context. The attack requires social engineering (convincing a user to click a link) but no authentication. A fix was released in version 2.2.1.

## Affected products

- Swagger API Swagger UI before 2.2.1

## Identifiers

- CVE-2016-1000233
- GHSA-mrx7-8hxf-f853

## Timeline

- 2016-01-12: disclosed
- 2016: patched: Fixed in version 2.2.1

## References

- [https://github.com/swagger-api/swagger-ui/issues/1863](https://github.com/swagger-api/swagger-ui/issues/1863)

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