CVE-2016-5682 Cross-Site Scripting in swagger-ui
An attacker can execute arbitrary scripts in the victim's browser via the Default field in the Definitions section of Swagger-UI.
- 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 CVE-2016-5682?
CVE-2016-5682 is a medium-severity cross-site scripting vulnerability in Swagger-UI before 2.2.1, published on 10 Apr 2017. 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
Swagger-UI before 2.2.1 has XSS via the Default field in the Definitions section.
Weakness: CWE-79
Which versions are affected by CVE-2016-5682?
2 open source packages ship an affected version, including swagger-ui. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
swagger-ui npm | All versions | 2.2.1 |
swagger-ui npm | All versions | 2.2.1 |
Products include Smartbear Swagger-Ui.
How do I fix CVE-2016-5682?
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 CVE-2016-5682 being exploited?
There is no known exploitation of CVE-2016-5682 in the wild and no public exploit code.
Sources
Also known as GHSA-p239-93f7-h6xf.