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

Em.Handlebars.Utils.escapeExpression escapes = in 2.8 but doesn't in 2.7 #14297

Closed
GavinJoyce opened this issue Sep 15, 2016 · 6 comments
Closed

Comments

@GavinJoyce
Copy link
Member

GavinJoyce commented Sep 15, 2016

There seems to be a difference in return value from Em.Handlebars.Utils.escapeExpression in Ember 2.7 and Ember 2.8:

2.7: Em.Handlebars.Utils.escapeExpression("http://foo.com?a=") returns:
http://foo.com?a=

2.8: Em.Handlebars.Utils.escapeExpression("http://foo.com?a=") returns:
http://foo.com?a=

here's a twiddle: https://ember-twiddle.com/f3db021495d6dbbc1853c83a624e1faf?openFiles=controllers.application.js%2C

UPDATE: It [looks like](3.0.2 and 3.0.3) we were using an old version of Handlebars (3.0.2) which didn't escape =. ember-glimmer/lib/utils/string.js does escape it, bringing us up to date with latest Handlebars escaping rules.

This doesn't seem like an issue, support for escaping = was added in 2015 to prevent XSS.

I'm going to close this, please let me know if you think this is incorrect

@GavinJoyce
Copy link
Member Author

We appear to be escaping the = here:

screen shot 2016-09-15 at 12 50 42

@GavinJoyce
Copy link
Member Author

@GavinJoyce
Copy link
Member Author

In a running 2.7 app the = isn't present:

screen shot 2016-09-15 at 13 03 08

...snip...

screen shot 2016-09-15 at 13 03 15

@GavinJoyce
Copy link
Member Author

The = was added to handlebars back in September 2015 to fix handlebars-lang/handlebars.js#1083:

handlebars-lang/handlebars.js@83b8e84#diff-ae3504422051de557ee42ced88f17a34

@GavinJoyce
Copy link
Member Author

GavinJoyce commented Sep 15, 2016

@GavinJoyce GavinJoyce changed the title Output of Em.Handlebars.Utils.escapeExpression is different between 2.7 and 2.8 Em.Handlebars.Utils.escapeExpression escapes = in 2.8 but doesn't in 2.7 Sep 15, 2016
@GavinJoyce
Copy link
Member Author

This doesn't seem like an issue, support for escaping = was added in 2015 to prevent XSS.

I'm going to close this, please let me know if you think this is incorrect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant