Skip to content

[Security] XSS vulnerability in scrumHelper.js: escapeHtml() exists but is never applied to API-sourced data in report rendering #546

@PhilixTheExplorer

Description

@PhilixTheExplorer

Bug Description

Multiple XSS (Cross-Site Scripting) vulnerabilities exist in scrumHelper.js where user-controlled data from GitHub/GitLab API responses (PR titles, issue titles, commit messages, project/repo names) is injected directly into HTML via template literals without sanitization.

An escapeHtml() function already exists at line 1119 but is never called anywhere in the report rendering logic.

Note: Issue #524 covers XSS in popup.js. This issue is specifically about scrumHelper.js, which renders the actual scrum report content, a separate and equally critical attack surface.

Root Cause

All report HTML is built using unescaped template literal interpolation:

// PR/MR titles (lines 1783, 1794, 1807, 1817, 1820)
li = `<li><i>(${project})</i> - ${prAction} ... ${title}</a>...`;

// Commit messages (lines 1788, 1800-1801)
li += `<span>${commit.messageHeadline}</span>`;

// Issue titles (lines 1829-1838, 1851-1863)
li = `... <a href='${html_url}'>${title}</a>...`;

// Reviewed PR titles (lines 1464-1470, 1481-1488)
prText += "..." + pr_arr.title + "...";

The values title, project, commit.messageHeadline, and html_url all come directly from the GitHub/GitLab API and can contain attacker-controlled content.

Expected Behavior

All API-sourced strings should be escaped before HTML insertion using the existing escapeHtml() function (line 1119), preventing script execution.

Actual Behavior

Malicious HTML in PR titles, issue titles, commit messages, or repository names executes as JavaScript within the extension context or the email client compose window (when using "Insert to Email").

Affected Locations

Line(s) Content Variable(s)
1783 Draft PR rendering project, title
1788 Draft PR commit messages commit.messageHeadline
1794 Open PR rendering project, title
1800-1801 Open PR commit messages commit.messageHeadline
1807 GitLab closed MR rendering project, title
1817 Merged PR rendering project, title
1820 Closed PR rendering project, title
1829-1838 Next week issue rendering project, title
1851-1863 Issue rendering (all states) project, title
1464-1470 Reviewed PR (single) pr_arr.title
1481-1488 Reviewed PR (multiple) pr_arr1.title

Contribution Checklist

  • I have searched existing issues to ensure this bug hasn't been reported
  • I have provided clear reproduction steps
  • I have included relevant environment details
  • I have described both expected and actual behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions