Skip to content

Feature content is not HTML-escaped in email notification body #297

@innokenty

Description

@innokenty

Description

Feature titles and descriptions containing HTML tags are embedded unescaped into the email body.
Raw HTML tags appear in the rendered email instead of being displayed as plain text.

Steps to Reproduce

Create a feature with HTML in the title and description, assigned to an existing user:

POST /api/features
{
  "productCode": "intellij",
  "title": "<script>alert('XSS')</script>Malicious Feature",
  "description": "<img src=x onerror=alert('XSS')>Description",
  "assigneeUserId": "bob"
}

Actual email body received:

<html>
<body>
  <h2>FEATURE CREATED</h2>
  <pre>{"actor":"alice","featureCode":"IDEA-114","action":"created","title":"<script>alert('XSS')</script>Malicious Feature","status":"NEW"}</pre>
  <p><a href="http://localhost:8081/features/IDEA-114">View Details</a></p>
  <img src="http://localhost:8081/api/notifications/.../read" width="1" height="1" style="display:none" alt="" />
</body>
</html>

Expected: All HTML special characters in user-supplied content are escaped so that tags like <script> and
onerror= do not appear as raw HTML in the email.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions