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(RecipeWaiter): sanitize user input in addOperation to prevent XSS #2014

Merged
merged 2 commits into from
Apr 5, 2025

Conversation

0xh3xa
Copy link
Contributor

@0xh3xa 0xh3xa commented Apr 4, 2025

What:

Fix Description:

  • Using innerHTML directly introduces a potential XSS vulnerability by allowing injection of malicious code.
  • A recommended solution is to sanitize the input using the DOMPurify library: https://www.npmjs.com/package/dompurify.
  • If relying on external libraries is not preferred, please let me know and I can suggest an alternative approach.

image

Behavior Before

output.mp4

Behavior After (fix):

output.mp4

Producing the issue:

@a3957273
Copy link
Member

a3957273 commented Apr 5, 2025

dompurify is an excellent choice for sanitisation. Whilst in general we prefer minimizing the number of dependencies on this project for any security relevant functionality we should absolutely be using popular implementations wherever possible. Thanks for fixing an XSS issue!

@a3957273 a3957273 merged commit 5a3b7bc into gchq:master Apr 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug report: Reflected XSS XSS vulnerability in your website
2 participants