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

XSS injections on Labyrinth JS and Paint Activity #787

Closed
lp1dev opened this issue Apr 22, 2020 · 2 comments
Closed

XSS injections on Labyrinth JS and Paint Activity #787

lp1dev opened this issue Apr 22, 2020 · 2 comments
Labels
bug to be release Fixed, to be release
Milestone

Comments

@lp1dev
Copy link

lp1dev commented Apr 22, 2020

Hi!
Going through the code again I noticed two XSS injections on sugarizer.
The first one is on labyrinthJS, the text you input can be interpreted with a payload such as (watch out, whitespaces are important).

</><img src=h onerror=alert(JSON.stringify(localStorage)) />

The second one concerns PaintJS and is even more interesting as I think it could be triggered through a shared drawing on someone else's device :
When you add a text area to your canvas you can escape JavaScript with a payload such as :

<img src=h onerror=alert(JSON.stringify(localStorage)) />

I'm not 100% sure about the best way to solve this for sugarizer, but I can write a PR if this solution suits you :
I noticed you already have an input sanitization function (https://github.com/llaske/sugarizer/pull/231/files) which doesn't seems to be shared between activities, maybe it would be interesting to make it global so it can be used anywhere?

It seems to me that the removeTags function is safe enough, I tested it with examples from Jason Haddix's XSS payloads (https://raw.githubusercontent.com/danielmiessler/SecLists/master/Fuzzing/XSS/XSS-Jhaddix.txt) and custom payloads, it didn't fail to sanitize my inputs!

Cheers,

@llaske llaske added the bug label Apr 23, 2020
@llaske
Copy link
Owner

llaske commented Apr 23, 2020

You're right. Thanks.
At first, I suggest to repeat the same fix. There's no so much activities with input then rendering.

@llaske
Copy link
Owner

llaske commented Sep 1, 2023

Fixed in #1402

@llaske llaske added the to be release Fixed, to be release label Sep 1, 2023
@llaske llaske added this to the v1.8 milestone Apr 10, 2024
@llaske llaske closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug to be release Fixed, to be release
Projects
None yet
Development

No branches or pull requests

2 participants