Conversation
…F#10, F#17) getMenuItemHtml built the tray context menu's <li> markup by interpolating MenuItem.label and .icon directly into HTML with no escaping (F#08), and MenuItem.id directly into an inline onclick JS string with no escaping (F#10). A menu item sourced from untrusted content (eg. a remote page's title) could inject markup or break out of the onclick string to run arbitrary script when the tray menu renders. label/icon are now HTML-escaped, and the onclick handler's arguments are built with JSON.stringify and then HTML-attribute-escaped as a whole (JSON.stringify's own double quotes would otherwise collide with the onclick="..." attribute delimiter). OpenFinMessageBus.subscribe discarded the sender uuid/name that OpenFin's InterApplicationBus.subscribe callback provides, so listener code had no way to tell who sent a message and authorize accordingly (F#17, especially since the default senderUuid is "*"). subscribe now forwards uuid/name to the listener's event object. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #871 +/- ##
==========================================
+ Coverage 74.03% 74.13% +0.09%
==========================================
Files 16 16
Lines 1510 1523 +13
Branches 318 309 -9
==========================================
+ Hits 1118 1129 +11
- Misses 392 394 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getMenuItemHtmlbuilt the tray context menu's<li>markup by interpolatingMenuItem.label/.icondirectly into HTML with no escaping, andMenuItem.iddirectly into an inlineonclickJS string with no escaping. A menu item sourced from untrusted content (eg. a remote page's title) could inject markup or break out of theonclickstring to run arbitrary script when the tray menu renders.label/iconare now HTML-escaped, and theonclickhandler's arguments are built withJSON.stringifyand then HTML-attribute-escaped as a whole (JSON.stringify's own double quotes would otherwise collide with theonclick="..."attribute delimiter).OpenFinMessageBus.subscribediscarded the senderuuid/namethat OpenFin'sInterApplicationBus.subscribecallback provides, so listener code had no way to tell who sent a message and authorize accordingly (especially since the defaultsenderUuidis"*").subscribenow forwardsuuid/nameto the listener's event object.