You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Chosen was built, searches matched on options.text, not on options.html. This created a possible xss issue that needed to be addressed. You can read the thread for all the details, but the path chosen at the time was to match on options.html.
It is clear at this point that demand exists for matching on options.text (#581, #1119, #927, #905, #807) that we should find a way to do this safely (perhaps adding it as a configureable "use at your own risk" option).
Any PR that closes this issue must demonstrate clearly that it can fix the issues discovered in #73.
#1343 Adds a method for escaping text. I think this can be used to go back to option.text instead of option.html. I'll do some experimenting after it lands in master.
+1 for this. I haven't looked too deeply, so maybe I am over-simplifying. Isn't it just a matter of changing the winnow_results function to not search within option.html? How about option.value? As long as you keep the rendering the same, doesn't that avoid the xss issue? If it's because of the wrapping of an around the search text, I personally would rather see that removed so we can have custom html inside the option.
I'd like to use Chosen to have a drop down list with one OptGroup for named fills (e.g. a configured linear gradient) and another one with standard web colors (e.g. DarkGoldenRod). I'd like show a small box with the background color matching the named color, but cannot because of this issue.
@pfiller I think that for the search matching itself, using the text should be fine and will solve related issues. The matching string is not reinjected in the DOM as html. I think the PR fixing the XSS vulnerabilities changed all references to option.text without checking how it was used, thus changing too much
Activity
pfiller commentedon Apr 18, 2013
This is especially a problem with ember.js which includes script tags in select options.
Like this:
pfiller commentedon Jul 11, 2013
#1343 Adds a method for escaping text. I think this can be used to go back to
option.textinstead ofoption.html. I'll do some experimenting after it lands in master.GaryChamberlain commentedon Jul 15, 2013
+1 for this. I haven't looked too deeply, so maybe I am over-simplifying. Isn't it just a matter of changing the winnow_results function to not search within option.html? How about option.value? As long as you keep the rendering the same, doesn't that avoid the xss issue? If it's because of the wrapping of an around the search text, I personally would rather see that removed so we can have custom html inside the option.
I'd like to use Chosen to have a drop down list with one OptGroup for named fills (e.g. a configured linear gradient) and another one with standard web colors (e.g. DarkGoldenRod). I'd like show a small box with the background color matching the named color, but cannot because of this issue.
thx!
Globegitter commentedon Aug 1, 2013
👍 For now we just modified it ourselves to
option.textto get it to work with ember.js but would be good if there is an official fix.stof commentedon Nov 6, 2013
@pfiller I think that for the search matching itself, using the text should be fine and will solve related issues. The matching string is not reinjected in the DOM as html. I think the PR fixing the XSS vulnerabilities changed all references to
option.textwithout checking how it was used, thus changing too muchsimonexmachina commentedon Nov 6, 2013
@stof, yes I agree.