fix: Don't use HTML in panel titles, treat as text#2365
Merged
mofojed merged 3 commits intodeephaven:mainfrom Feb 7, 2025
Merged
fix: Don't use HTML in panel titles, treat as text#2365mofojed merged 3 commits intodeephaven:mainfrom
mofojed merged 3 commits intodeephaven:mainfrom
Conversation
- Golden Layout was setting the title in panel titles with `.html()` method, which allows remote code execution, and potentially could craft a notebook with a malicious name that could run arbitrary JS - Instead just use `.text` and treat it like text, as we should. - Tested on DHC - created a notebook with the name `<img src=q onerror=prompt(1)>.py`. It now appears correctly as text and does not pop up an alert message
bmingles
requested changes
Feb 7, 2025
Contributor
bmingles
left a comment
There was a problem hiding this comment.
Unit tests are failing. Looks like they need to be updated with escaped values.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2365 +/- ##
==========================================
- Coverage 46.74% 46.72% -0.03%
==========================================
Files 710 710
Lines 39125 39143 +18
Branches 9779 9972 +193
==========================================
Hits 18289 18289
- Misses 20825 20843 +18
Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
.html()method, which allows remote code execution, and potentially could craft a notebook with a malicious name that could run arbitrary JS.textand treat it like text, as we should.<img src=q onerror=prompt(1)>.py. It now appears correctly as text and does not pop up an alert message. Also verified that title still appears in italics when in "preview" mode.