{"id":"GHSA-22q9-hqm5-mhmc","aliases":[],"status":"published","title":"Cross-Site Scripting in swagger-ui","description":"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.\n\n\n## Recommendation\n\nUpgrade to version 2.2.1 or later.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2020-09-11T21:22:24Z","modified":"2023-01-09T05:04:07Z","fixes":[{"ecosystem":"npm","package":"swagger-ui","fixed_in":["2.2.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"swagger-ui","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.1"}]}]},{"source":"osv","ecosystem":"npm","package":"swagger-ui","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.2.1"}]}]}],"references":[{"url":"https://github.com/swagger-api/swagger-ui/issues/1154","tags":["web"]},{"url":"https://www.npmjs.com/advisories/987","tags":["web"]},{"url":"https://github.com/advisories/GHSA-22q9-hqm5-mhmc"},{"url":"https://github.com/swagger-api/swagger-ui","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-22q9-hqm5-mhmc","title":"Cross-Site Scripting in swagger-ui","description":"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.\n\n\n## Recommendation\n\nUpgrade to version 2.2.1 or later.","status":"published","published":"2020-09-11T21:22:24Z","modified":"2023-01-09T05:04:07Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:08.863482Z"}],"osv":[{"id":"GHSA-22q9-hqm5-mhmc","title":"Cross-Site Scripting in swagger-ui","description":"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.\n\n\n## Recommendation\n\nUpgrade to version 2.2.1 or later.","status":"published","published":"2020-09-11T21:22:24Z","modified":"2021-09-28T17:01:08Z","cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:33.520522Z"}]}}
