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) #2367

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:31
@mofojed mofojed self-assigned this Feb 10, 2025
Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

LGTM

@mofojed mofojed merged commit e3355a3 into deephaven:release/v0.78 Feb 13, 2025
8 checks passed
@mofojed mofojed deleted the xss-fix-v0.78 branch February 13, 2025 15:31
@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