XSS vulnerabilities
There are 2 XSS vulnerabilities from different type of content.
How to reproduce
- Title:
- Create a new story with the title :
<img src=x onerror=alert(0)>
- Visit the list of stories
<URL>/stories
or the page of the story - Payload is executed
- Create a new story with the title :
- Content:
- Create a new story with the content :
<img src=x onerror=alert(0)>
- Visit the page of the story
- Payload is executed
- Create a new story with the content :
Solution
- Escape HTML special characters for the title
- For the content, with the use of HTML formatting, you may want to use a library like DOMPurify.
Edited by Framartin