-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When returning an HTML error, make sure it's safe (#1763)
* When calling into an API specifying a crafted format that is HTML, the returned error renders the HTML back to the user, causing a potential XSS issue. For 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. When an error generates html back to the user, make sure it's properly escaped. Fixes issue #1762 * Add changelog entry * Use a method that also works in rails3 * Add spec formatting for older rails/activesupport version
- Loading branch information
Showing
4 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters