swagger-ui
swagger-ui copied to clipboard
Response headers are not escaped when generating the curl command, allowing for XSS
To reproduce, hit an API endpoint that returns a response with a Content-type of <script>alert(1)</script>. The script will be injected into the page and will execute. An example sinatra server is attached that can be used to reproduce. Set /swagger.json as the JSON file, and try the GET /v2/pet/1 call.
The sinatra file can be found here, you will need to gem install sinatra before running:
https://gist.github.com/joevennix/df28a686471860e0d562