GHSA-vp93-gcx5-4w52 Cross-Site Scripting in swagger-ui
Attackers can execute arbitrary JavaScript in swagger-ui by injecting scripts into method descriptions, requiring user interaction to trigger.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-vp93-gcx5-4w52?
GHSA-vp93-gcx5-4w52 is a cross-site scripting vulnerability in swagger-ui, published on 11 Sep 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Versions of swagger-ui prior to 2.2.1 are vulnerable to Cross-Site Scripting (XSS). The package fails to sanitize JSON schemas, allowing attackers to execute arbitrary JavaScript using <script> tags in the method descriptions.
Recommendation
Upgrade to version 2.2.1 or later.
Which versions are affected by GHSA-vp93-gcx5-4w52?
2 open source packages ship an affected version, including swagger-ui.
| Package | Affected | Fixed in |
|---|---|---|
swagger-ui npm | All versions | 2.2.1 |
swagger-ui npm | All versions | 2.2.1 |
How do I fix GHSA-vp93-gcx5-4w52?
Upgrade swagger-ui to 2.2.1 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is GHSA-vp93-gcx5-4w52 being exploited?
There is no known exploitation of GHSA-vp93-gcx5-4w52 in the wild and no public exploit code.