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

escapeParameterHtml flag: Don't escape ampersand (&) symbol #1019

Closed
gardarh opened this issue Oct 19, 2020 · 1 comment
Closed

escapeParameterHtml flag: Don't escape ampersand (&) symbol #1019

gardarh opened this issue Oct 19, 2020 · 1 comment

Comments

@gardarh
Copy link
Contributor

gardarh commented Oct 19, 2020

I recently pushed a PR that implemented the escapeParameterHtml flag. In using this flag I have noticed one undesired side effect: In some cases it's hard to avoid a "double-escape" scenario, i.e.:

<div text="$t('some_resource_with_foo_variable', {foo: 'a & b'}" />

Yields the following:

a &amp; b

A mitigation would be to use v-html in the div tag but it feels like suggesting that would cause more harm than benefit. By not escaping the & symbol we we avoid this situation. This proposed change also converts this functionality into an idempotent one, i.e. the escape operation can be performed multiple times without producing multi-escaped output.

The negative security impact is minimal since a) we are already escaping the < and > symbols and b) this flag was introduced very recently and likely still has little usage.

gardarh pushed a commit to gardarh/vue-i18n that referenced this issue Oct 19, 2020
kazupon pushed a commit that referenced this issue Oct 19, 2020
Co-authored-by: Gardar Hauksson <gardarh@payanalytics.com>
@kazupon
Copy link
Owner

kazupon commented Oct 19, 2020

relesed v8.22.1

@kazupon kazupon closed this as completed Oct 19, 2020
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

2 participants