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

Warning needed about HTML Injection (Sanitized) with user-entered data #220

Open
samueldmeyer opened this issue Feb 15, 2023 · 0 comments
Open

Comments

@samueldmeyer
Copy link

HTML Injection is possible if users of this library make [data] use user-supplied text

Expected result

A developer using this library is likely to assume that a name like "<i>italic</i>" would appear exactly as is.

Actual result

Today, a name like "<i>italic</i>" will be rendered as HTML.

Steps to reproduce

Add a name with HTML in the data.

https://stackblitz.com/edit/angular-ng-autocomplete-with-images-yowqbm?file=src%2Fapp%2Fapp.component.ts

Context

It is not clear from the documentation that HTML will be passed to the template (yes, I realize innerHTML should be a large hint, but I saw it missed). Can the example in the README be updated to note that user-generated text needs to be escaped?

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