
Cloud Vulnerability DB
A community-led vulnerabilities database
A critical cross-site scripting (XSS) vulnerability was identified in swagger-ui versions prior to 2.2.1. The vulnerability was discovered in September 2015 and officially published to the GitHub Advisory Database on September 1, 2020. The issue affects the swagger-ui npm package and allows for XSS attacks through the URL query string parameter (GitHub Advisory).
The vulnerability stems from improper sanitization of the URL parameter in the message bar functionality. The issue was initially fixed but was reintroduced in version 2.1.0-M1 when the code reverted from using .text() to .html() for handling URL data, allowing potential XSS payloads to be executed (Swagger Issue). The vulnerability is tracked as GHSA-g336-c7wv-8hp3 and is classified as CWE-79 (Cross-site Scripting) with a Critical severity rating (GitHub Advisory).
This vulnerability could allow attackers to execute arbitrary JavaScript code in the context of users' browsers who visit a maliciously crafted URL. This could potentially lead to theft of sensitive information, session hijacking, or other client-side attacks (GitHub Advisory).
The vulnerability can be exploited by crafting a malicious URL that includes JavaScript code in the query string parameter. The issue was confirmed to be exploitable in versions prior to 2.2.1, with proof-of-concept demonstrations showing successful XSS execution through the URL parameter (Swagger Issue).
The recommended mitigation is to update swagger-ui to version 2.2.1 or later, which includes the security fix for this vulnerability. The fix implements proper sanitization of the URL parameter to prevent XSS attacks (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."