-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fixes open vulnerabilities for #38 #49
Conversation
ac5ddfb
to
3aae4cc
Compare
Hey @samschurter I was wondering if you will resolve that conflict. |
@LAG1996 No, I don't think so. This is a dead PR. It was opened long before the pull request that caused that conflict, yet this PR has received no reviews. The people running this project now have no interest in fixing the vulnerabilities. |
Sorry but this is basically not true =) |
cc @materializecss/members |
I'm sorry, but I feel not confident about reviewing this one. Anyway, I see you created new tests. Should these... added to the Jasmine tests? |
Would like to see this merged please. Even if it is BC 2 years is due time for a Major Semver. |
cc: @DanielRuf |
Thanks for your contributions @samschurter. CI is green and the relevant changes are documented. I also think we can move forward with this and finally break some setups. Let's merge it. |
You should have received an invitation to join @materializecss as member and collaborator for https://materializecss/materialize. |
Does anyone know how to flag the new version as having patched this advisory? That way NPM could run an automatic upgrade, although that probably shouldn't happen till 1.1.0 is stable. |
Not sure what you mean with "automatic upgrade". See also https://github.com/materializecss/materialize/security/advisories https://www.npmjs.com/advisories?page=7&perPage=100 |
Does it use the v1.1.0-alpha? What does |
ah, my mistake, I still had the old version installed. Removing that fixed this. |
Docs on how to use it can be found here: https://materializecss.github.io/materialize/toasts.html unsafeHTML is a string, not a bool. |
thanks, @ChildishGiant In my case tool tips are generated dynamically based on RSVP details in a DB. There could be dozens of them on the page. With the old materialize in my jinja template I would just create the dynamic HTML within the This worked and it was simple and great. All the looping happened in the context of the object in my template and they were initialized with a single js call. Now it seems I have to create unique IDs for each tooltip, generate the html in the <script> section with some-way to correlate it to the specific tooltip ID, and then write javascript to initialize each one individually (rather than a single line of js I did before). Am I understanding that correctly, or am I missing something super obvious? Is there a way to include the html in another Imagine a world where the tooltip example here https://materializecss.com/tooltips.html showed different HTML contents (instead of just "I am a tooltip!") for each bottom, top, left, right buttons. Would you have to initialize each one separately? Thanks! |
I checked the updated documentation and the source code and I agree with the criticism. I guess the unsafeHTML fix needs an improvement by refactoring the programming interface. As of now, toasts require an onclick handler which is both clumsy and disagreeable with the Content Security Policy option allowing servers to disable inline scripts. The tooltips, on the other hand, look perfect in terms of initialization and handling, but the unsafeHTML option, instead of allowing all tooltips to be unsafe, allows only addition of a single unsafe HTML to all tooltips. So I guess toasts could use the same approach as tooltips in terms of initialization/handling, and then the unsafeHTML option needs changing from a string to a boolean. Perhaps, with the new paradigm, one does not have to worry about backward compatibility and one could use the unsafeHTML option name or even rename it. |
Hi @ilatypov, thanks for your feedback. That sounds good and I agree with you. Any contribution is very welcome. If you have the time and want to help, you can provide a PR which improves this. As we still did not do a new stable release (https://github.com/materializecss/materialize/releases), breaking changes are fine. |
I notice that the changes have been merged, but I haven't seen a new release yet. Is |
@Skopea 2.0.3 is the latest version. https://www.npmjs.com/package/@materializecss/materialize |
looking at bad URL :) |
This should deal with the open CVEs referenced in #38, Dogfalo#6286, and Dogfalo#6331
Proposed changes
CVE-2019-11002 (
tooltip
component)text
andunsafeHTML
data-tooltip
attribute to set thetext
property instead ofhtml
(breaking change)text
as.textContent
html/unsafeHTML
as HTMLunsafeHTML
is used,html
will be ignoredhtml
is deprecated, and added warnings tounsafeHTML
CVE-2019-11004 (
toast
component)text
andunsafeHTML
text
as.textContent
html/unsafeHTML
as HTMLunsafeHTML
is used,html
will be ignoredhtml
is deprecated, and added warnings tounsafeHTML
CVE-2019-11003 (
autocomplete
component)allowUnsafeHTML
option defaulting tofalse
allowUnsafeHTML: true
then behavior is unchangedallowUnsafeHTML
remainsfalse
, then the autocomplete data key is injected astextContent
Screenshots (if appropriate) or codepen:
Couldn't figure out how to do a codepen with the re-compiled javascript. If you clone the PR and compile it then the examples under
test/html
for autocomplete, toast, and tooltips will demonstrate the changes.Types of changes
Checklist: