CVE-2016-1000226: XSS in npm swagger-ui through 2.2.0
The npm swagger-ui package through version 2.2.0 contains a cross-site scripting vulnerability in its rendering of Swagger definition data. Crafted values in the consumes or produces fields of a Swagger JSON document can inject script into the Swagger UI page. The query-string mechanism for selecting a Swagger definition permits a crafted link to cause Swagger UI to load an attacker-controlled definition.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
A successful exploit executes arbitrary JavaScript in the origin hosting Swagger UI and in the victim's authenticated browser context. This may permit theft of session material or tokens accessible to that origin, interface manipulation, and execution of actions as the victim against services reachable through the hosted Swagger UI context.
Mitigation
If you can’t patch tonight, do this now.
Restrict access to Swagger UI and prevent untrusted parties from supplying Swagger definition locations or hosting definitions that the interface can load. Where feasible, block or remove support for the query-string definition-selection mechanism. Deploy a restrictive Content Security Policy as a compensating control, recognizing that it is not a complete remediation.
Remediation
Patch, then assume compromise.
Upgrade npm swagger-ui to version 2.2.1 or later.
Exploits
No public exploits tracked yet. Mallory keeps watching.
References
Frequently asked questions
- Is CVE-2016-1000226 exploited in the wild?
- As of Sep 26, 2026, Mallory has no reports of CVE-2016-1000226 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2016-1000226?
- As of Sep 26, 2026, Mallory has found no public exploit for CVE-2016-1000226.
- Is there a patch for CVE-2016-1000226?
- Upgrade npm swagger-ui to version 2.2.1 or later.
Recent activity
1 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.