# GHSA-vp93-gcx5-4w52: Cross-Site Scripting in swagger-ui

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-11T21:21:19.000Z
- Modified: 2021-09-28T17:00:47.000Z
- Weaknesses: CWE-79

## 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.

(As written by GitHub Advisory Database.)

## Affected

- swagger-ui (npm): before 2.2.1

## References

- <https://github.com/swagger-api/swagger-ui/issues/1864> (web)
- <https://github.com/swagger-api/swagger-ui> (package)
- <https://www.npmjs.com/advisories/986> (web)

## Sources

- GitHub Advisory Database: [GHSA-vp93-gcx5-4w52](https://github.com/advisories/GHSA-vp93-gcx5-4w52), CC-BY-4.0, modified 2021-09-28

---

Page: https://cve.day/GHSA-vp93-gcx5-4w52 · Whole record: https://cve.day/GHSA-vp93-gcx5-4w52.json · Rebuilt by cve.day 2026-11-25T22:56:46.692Z
