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

[24.2] Set content-type to text/plain if dataset not safe #19563

Draft
wants to merge 2 commits into
base: release_24.2
Choose a base branch
from

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Feb 6, 2025

We only care about XSS in the context of the webapp, and for that it is sufficient to set the content-type to text/plain.
We might be passing large secondary files through this which has performance implications.

Also adds a sanitization message and a loading indicator for the iframe content if we're hitting a preview route.

Screenshot 2025-02-07 at 12 45 34

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:

Create an HTML file with a tool that creates HTML files (multiqc, fastqc etc). Click on the eye icon and see that the file is displayed as text if it is not on the allow list. Hardcode content-type on line 647 to text/html to see that now it is rendered as html. Hardcode it back to text/plan and see it displayed as text.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

We only care about XSS in the content of the webapp, and for that it is
sufficient to set the content-type to text/plain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant