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

XSS vulnerability using element.html(translation) #20

Open
ronwang01 opened this issue Mar 18, 2017 · 2 comments
Open

XSS vulnerability using element.html(translation) #20

ronwang01 opened this issue Mar 18, 2017 · 2 comments

Comments

@ronwang01
Copy link

Translate-once is calling element.html(translation), which poses a vulnerability if the key is not in the resource dictionary and contains malicious code (e.g. XSS attack.).

@atticoos
Copy link
Owner

atticoos commented Mar 18, 2017

Interesting, I notice angular-translate uses append, which is essentially the same.

From what I can tell, when the translation key fails to be found in the resource dictionary, the translationId would be passed as the value that gets appended in applyTranslation.

We could use .text when the key is not found, but I find it interesting the main project doesn't seem to enforce this.

You should open an issue in angular-translate and see what the team says. This is essentially an extension to that project, so if they aren't enforcing that, adding it to this project won't help much. Now that's not to say I'm against the idea, but I would like to hear their thoughts too.

Thanks for raising this concern

@ronwang01
Copy link
Author

ronwang01 commented Mar 20, 2017

Just did a quick search, they are aware of the issue. The issue been added to their Milestone 2.16.0. Thank you, for your attention in this matter, much appreciated.
https://github.com/angular-translate/angular-translate/issues/1418

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