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

injection vulnerability #123

Open
hohwille opened this issue Feb 14, 2017 · 2 comments
Open

injection vulnerability #123

hohwille opened this issue Feb 14, 2017 · 2 comments

Comments

@hohwille
Copy link

In case a user of grow does something like growl.error(errorMessageWithUserInput) then the client gets vulnerable for injection and XSS. This way an evil hacker can read cookies and send it to evil sites.
IMHO growl should already prevent such vulnerability e.g. by using $sanitize (https://docs.angularjs.org/api/ngSanitize/service/$sanitize). Filtering/escaping all markup would also be fine for me but maybe some growl users like to do injection of markup such as ul, string, em, etc. in growl messages.

@flippinjoe
Copy link
Collaborator

Maybe I'm misunderstanding where your problem is. In growlMessageService.js Line: 101

message.text = $sce.trustAsHtml(String(message.text));

Which all messages pass through this before being displayed. Are you saying that this logic is being bypassed in certain situations?

@dgsmith2
Copy link

@morgenes noticed this vulnerability as well. If the message contains user supplied text, scripts can be run when the message is displayed (e.g., <script>console.log('gotcha')</script>). We take advantage of the fact messages are rendered as HTML because we want to have working links in our messages. To combat the XSS we are using Lodash's _.escape() on user-supplied input that is rendered in a message.

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

3 participants