Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
extension system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jun 2015 at 14:39 UTC
Updated:
3 Aug 2015 at 12:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cilefen commentedComment #2
droplet commentedany idea how to set allowed tags in inline_template ?
Comment #3
LKS90 commentedThe patch works for me, I don't have an answer for your question though.
Comment #4
cilefen commented#2280965: [meta] Remove every SafeMarkup::set() call contains some suggested patterns for avoiding SafeMarkup::set().
Comment #5
cilefen commentedI searched around a bit but couldn't figure it out.
Comment #6
cilefen commented@LKS90 HEAD is using an inline twig template to safely render the table of module names. Some commit has broken this search form by stripping the
<label>tag. The question in #2 was over how one would allow the label tag to pass through.Comment #7
cilefen commentedI found it.
Comment #8
tr commentedXss.php hasn't changed its list of allowed tags since it was first created more than two years ago in commit 23b59123. Adding a new tag to the allowed list in Xss.php may avoid this particular problem, but it will have very wide consequences (every module uses Xss::filter() at some point) and may impact security.
The issue which broke the uninstall page is #2273925: Ensure #markup is XSS escaped in Renderer::doRender() (I used git bisect). IMO a proper fix will be to address how to use known-good markup in an inline_template element, now that this markup is being automatically sanitized. The patch in #1 is a solution, but it would be nice to keep the inline_template here if possible (see #2280965: [meta] Remove every SafeMarkup::set() call). Unfortunately, SafeMarkup::set() doesn't work in the inline_template. If the uninstall page has this problem, it's inevitable that it will show up again, especially in contrib, so it makes sense to figure out a global fix rather than just make <label> a safe tag like in #7.
Comment #9
droplet commentedahh. So SafeMarkup::format is the best option at the moment.
Comment #10
droplet commentedComment #11
cilefen commentedWe need commas after the last array elements.
Comment #12
droplet commentedthat's args for the function. adding commas would cause syntax errorComment #13
droplet commentedComment #14
cilefen commented+1 for RTBC. This path is in-scope and uses one of the allowed sanitization methods.
I hate to be a nudge but there should be a comma here also as the end of the multiline 'data' array element.
Comment #15
droplet commentedCool, no problems :)
Comment #16
cilefen commentedI added a small regression test.
Comment #18
droplet commentedComment #21
tr commentedComment #23
alexpottThe result of inline templates should be marked safe. This is indicative of a larger issue.
Comment #24
alexpottWe need to do something like this. btw this is a really nice find. Glad we're dealing with this now.
Comment #25
alexpottComment #26
alexpottRetitling to detail what the actual issue is.
Comment #28
star-szrComment #29
joelpittetWow surprised we didn't run into this already. Thanks for the test coverage @alexpott.
Comment #30
tr commentedI tested the patch and indeed it solves this specific problem (filtering on uninstall modules page is broken) and also the larger issue of using known-good markup in an inline_template. The added test ensures that the markup required by the JavaScript for the filter to work is present - that should preclude this from getting broken again.
+1.
Comment #31
catchCommitted/pushed to 8.0.x, thanks!