Closed
Description
If you issue a request into an API endpoint with a format specified that is not handled, you get back a 406 error with message 'The requested format 'format' is not supported.'
The name of the specified format is rendered in the error message, which defaults as HTML. You can easily craft a format value that gets passed in and renders as an XSS. An example:
http://example.com/api/endpoint?format=%3Cscript%3Ealert(document.cookie)%3C/script%3E
Renders as html:
The requested format '<script>alert(document.cookie)</script>' is not supported.
Which will cause a javascript popup if you visit this page in a browser.