Cross-Site Scripting in swagger-ui
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.
Summary
Versions of `swagger-ui` prior to 2.2.1 are vulnerable to Cross-Site Scripting (XSS). The package fails to encode output in GET requests. The request is meant to respond with Content-Type `application/json` which does not trigger the vulnerability but if the web server changes the header to `text/html` it may allow attackers to execute arbitrary JavaScript. ## Recommendation Upgrade to version 2.2.1 or later.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | swagger-ui (npm) | before 2.2.1 | 2.2.1 | Patch available | GHSA-22q9-hqm5-mhmc |
- swagger-ui (npm) Vendor— Affected before 2.2.1 Fixed in 2.2.1 Patch available GHSA-22q9-hqm5-mhmc
Remediation
- Fix · GHSA-22q9-hqm5-mhmc swagger-ui (npm) Fixed in 2.2.1 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-22q9-hqm5-mhmc
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences