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

Input tag via Field component error messages susceptible to XSS #2444

Closed
CristinaSolana opened this issue Apr 28, 2020 · 3 comments
Closed

Comments

@CristinaSolana
Copy link

CristinaSolana commented Apr 28, 2020

Overview of the problem

Buefy version: 0.8.17
Vuejs version: 2.X.X
OS/Browser:

Input tag via field component error messages susceptible to XSS. The issue is the v-html used here: https://github.com/buefy/buefy/blob/dev/src/components/field/Field.vue#L35

Screen Shot 2020-04-27 at 9 32 04 AM

Steps to reproduce

  1. Go to https://buefy.org/documentation/input
  2. Scroll down to Icons section
  3. in the email field enter: ">
  4. Press Tab key

Expected behavior

The error message should not parse HTML (or sanitize it firs) so that XSS is not possible

Actual behavior

Error message parses HTML and allows XSS and therefore the alert pops with the document's domain

@CristinaSolana CristinaSolana changed the title Input tag error messages susceptible to XSS Input tag via Field component error messages susceptible to XSS Apr 28, 2020
@jtommy
Copy link
Member

jtommy commented Apr 29, 2020

What do you think if I add a message slot in order to use a custom content ?

@CristinaSolana
Copy link
Author

CristinaSolana commented Apr 30, 2020

Tbh, what I think would be great is if the message and the error were separate so you could have a custom message and custom error on the field, both without the use of v-html. :)

For the sake of not having an XSS by default on fields, I think a slot is a good compromise if it will eliminate the v-html.

@jtommy
Copy link
Member

jtommy commented May 2, 2020

Close f0ff2ae

@jtommy jtommy closed this as completed May 2, 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

Successfully merging a pull request may close this issue.

2 participants