-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Version 2.0.8 VS 2.2.7 different output on the same input #532
Comments
from some further investigation I believe that the bug consist in these lines:
The lookupGetter method is failing for some reasons. By replacing with
it works as expected |
Heya, this should address your problem afaics :) |
what is the reason to use a wrapper function |
I think possible DOM Clobbering was the reason here, cc @securitum-mb |
I am trying to integrate the proposal here #502 as polyfill in the phantomJS, but seems not workinig |
I don't think there is much we can (or want to) do here. PhantomJS has been discontinued, there is known vulnerabilities as well - it makes no sense for us to change anything in the core to support PhantomJS. |
Unfortunaately we have a lot of legacy tests, we need still to maintain in the transition process that will take a long time. In the mean time this is a local patch I am using to solve the issue:
IYO is this a valid patch without introducing xss attacks? |
I think it might in the worst case enable DOM clobbering, but not sure about XSS. |
Closing this for now, nothing - afaics - we can do here. |
I wouldn't close this issue simply because it breaks the backward compatibility. I think this patch is valid:
the code should fall in the second case only in not supporting browsers. |
Yeah, I think this might be a valid patch indeed. Let me try and run some tests. |
@albanx Please check, does this do the trick for you? |
Yes, looks good |
Cool, thanks for being adamant! |
Just tested the new version. It introduced another break for phantomJS, exactly this line:
Seems that phantomJS does not support By replacing with the old line |
This extra parameter is needed by MSIE10 and MSIE11 - things will break without it. |
Background & Context
Consider this HTML to sanitize:
When running on casper / phantonJS the version 2.0.8 works fine and returns the full html stripping out just
<allowStyleAsFirstTag/>
The last version of Dompurify 2.2.7 instead removes all HTML returning an empty string.
Bug
Remove HTML that shouldn't be removed on specific browser engines.
Input
Given output
EMPTY
Expected output
Digging into the code all comes to this lines of DOMPurify 2.2.7:
Replacing the above with the old method in 2.0.8, works fine:
Any thoughts?
Thanks
Alban
The text was updated successfully, but these errors were encountered: