Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't use HTML in panel titles, treat as text (#2365) #2366

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Feb 10, 2025

  • 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. Also verified that title still appears in italics when in "preview" mode.
  • Fixes DH-18645

- 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. Also verified that title still appears in
italics when in "preview" mode.
- Fixes DH-18645
@mofojed mofojed requested a review from bmingles February 10, 2025 13:30
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.71%. Comparing base (1d8d9c3) to head (f3b3d23).
Report is 1 commits behind head on release/v0.85.

Additional details and impacted files
@@              Coverage Diff               @@
##           release/v0.85    #2366   +/-   ##
==============================================
  Coverage          46.71%   46.71%           
==============================================
  Files                689      689           
  Lines              38623    38623           
  Branches            9809     9809           
==============================================
  Hits               18043    18043           
- Misses             20528    20570   +42     
+ Partials              52       10   -42     
Flag Coverage Δ
unit 46.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mofojed mofojed requested a review from mattrunyon February 13, 2025 15:31
@mofojed mofojed self-assigned this Feb 13, 2025
@mofojed mofojed merged commit 8e511a0 into deephaven:release/v0.85 Feb 13, 2025
11 checks passed
@mofojed mofojed deleted the xss-fix-v0.85 branch February 13, 2025 15:41
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants