XSS in issue and PR titles #1533

Closed
opened 2025-11-02 04:04:04 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @pgaskin on GitHub (Feb 14, 2018).

Description

I discovered this issue while using my gitea instance.

When editing a title, it appears in the comments (user changed title to .....), which does not sanitize the html.

Demo (it's safe, just shows a message): https://try.gitea.io/geek1011/XSS/issues/2

Originally created by @pgaskin on GitHub (Feb 14, 2018). - Gitea version (or commit ref): 4c9d9c221a0628753f3dc16b469330ee096cbf18 - Can you reproduce the bug at https://try.gitea.io: - [X] Yes (provide example URL) - [ ] No - [ ] Not relevant ## Description I discovered this issue while using my gitea instance. When editing a title, it appears in the comments (`user changed title to .....`), which does not sanitize the html. Demo (it's safe, just shows a message): https://try.gitea.io/geek1011/XSS/issues/2
GiteaMirror added the topic/securitytype/bug labels 2025-11-02 04:04:04 -06:00
Author
Owner

@pgaskin commented on GitHub (Feb 14, 2018):

To fix this issue, a translation (issue.change_title_at) needs to be changed, because it includes a <b> tag, which requires the use of the Safe filter, which skips sanitizing the HTML. After the translation and the template is changed, the title does not need to skip sanitation anymore.

@pgaskin commented on GitHub (Feb 14, 2018): To fix this issue, a translation (`issue.change_title_at`) needs to be changed, because it includes a `<b>` tag, which requires the use of the `Safe` filter, which skips sanitizing the HTML. After the translation and the template is changed, the title does not need to skip sanitation anymore.
Author
Owner

@lafriks commented on GitHub (Feb 14, 2018):

Title can be escaped separately

@lafriks commented on GitHub (Feb 14, 2018): Title can be escaped separately
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1533