Skip to content

Modernized help UI prototype: Fix DOM-based XSS vulnerability#2677

Open
howlger wants to merge 1 commit into
eclipse-platform:masterfrom
howlger:patch-7
Open

Modernized help UI prototype: Fix DOM-based XSS vulnerability#2677
howlger wants to merge 1 commit into
eclipse-platform:masterfrom
howlger:patch-7

Conversation

@howlger
Copy link
Copy Markdown
Contributor

@howlger howlger commented May 29, 2026

When the modernized help UI is activated, this vulnerability can be reproduced by creating a search scope with the following name: scope1<video src=0 onloadstart=alert('XSS')>
This will cause an alert box to pop up, proving that the JavaScript code within the scope name will be executed.

Caused by:
The search scope configuration page is created dynamically via JavaScript: A button element is inserted into the DOM for each scope. However, the scope name is incorrectly set to the button as innerHTML rather than textContent or a child text node.

Type of vulnerability:
DOM-based or type-0 cross-site scripting (XSS)
See: https://owasp.org/www-community/attacks/DOM_Based_XSS

Attack vector:
The attacker tricks the user into entering a scope name, containing the malicious JavaScript code.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Test Results

    54 files  ±0      54 suites  ±0   34m 30s ⏱️ - 1m 59s
 4 667 tests ±0   4 645 ✅ ±0   22 💤 ±0  0 ❌ ±0 
11 895 runs  ±0  11 742 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 01285da. ± Comparison against base commit a372a8c.

♻️ This comment has been updated with latest results.

This vulnerability can be reproduced by creating a search scope with the following name:
  scope1<video src=0 onloadstart=alert('XSS')>
This will cause an alert box to pop up, proving that the JavaScript code within the scope name will be executed.

Caused by:
The search scope configuration page is created dynamically via JavaScript: A button element is inserted into the DOM for each scope. However, the scope name is incorrectly set to the button as `innerHTML` rather than `textContent` or a child text node.

Type of vulnerability:
DOM-based or type-0 cross-site scripting (XSS)
See: https://owasp.org/www-community/attacks/DOM_Based_XSS

Attack vector:
The attacker tricks the user into entering a scope name, containing the malicious JavaScript code.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a DOM-based XSS in the modernized help UI’s search scope configuration by ensuring user-controlled scope names are inserted into the DOM as text rather than HTML.

Changes:

  • Stop rendering custom scope names via innerHTML when building the scope list.
  • Render scope names via a text node (through the createButton(..., text) path) to prevent script execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants