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

Prevent XSS #374

Closed
NTVNgan opened this issue Oct 13, 2022 · 11 comments
Closed

Prevent XSS #374

NTVNgan opened this issue Oct 13, 2022 · 11 comments
Labels
bug Something isn't working in progress This is currently being worked on priority To be fixed in priority

Comments

@NTVNgan
Copy link

NTVNgan commented Oct 13, 2022

Describe the bug

Currently we has not apply yet any protection from XSS exploit as below.

Steps to reproduce

  1. Boxchat write '<img src=x onerror=alert('hi') />'
  2. Broswer show alert hi beacause in code use v-html

Expected behavior

Prevent XSS

Screenshots

xss

Device (please complete the following information)

Package version: 1.5.7

@NTVNgan NTVNgan added the bug Something isn't working label Oct 13, 2022
@antoine92190
Copy link
Collaborator

Yes I am aware of this issue, thanks for pointing it out. I will fix it shortly

@antoine92190 antoine92190 added the priority To be fixed in priority label Oct 30, 2022
@chriswalg
Copy link

you can use https://www.npmjs.com/package/dompurify to prevent xss

@antoine92190 antoine92190 added the in progress This is currently being worked on label Apr 27, 2023
@chriswalg
Copy link

issue is not closed for me. I can reproduce xss.

@antoine92190 antoine92190 reopened this Dec 1, 2023
@aerovulpe
Copy link
Member

Hey @chriswalg, what version of vue-advanced-chat are you using?

@chriswalg
Copy link

I tested on 2.0.8 and 2.0.10

@aerovulpe
Copy link
Member

aerovulpe commented Dec 2, 2023

Please share the text content you used to trigger the XSS.

I've tested with <img src=x onerror=alert('hi') /> on the demo app to verify the rendered HTML is sanitized, and it seems to be correct.

image

@chriswalg
Copy link

you are right, it cannot be reproduced in the large chat window in which all messages are displayed. i can only reproduce it in the small chat window.

@aerovulpe
Copy link
Member

Please share a screenshot. Also, what do you mean by the small chat window? Thanks!

@chriswalg
Copy link

brave_screenshot_localhost (6)

@chriswalg
Copy link

on https://vue-advanced-chat-app.netlify.app/chat is xss also reproducable.

@aerovulpe
Copy link
Member

Hey @antoine92190, I don't think https://vue-advanced-chat-app.netlify.app/chat has been updated to the latest library version. Also, I'm not familiar with the small chat window view @chriswalg is referencing. If it's using src/components/FormatMessage/FormatMessage.vue, then it should also prevent XSS with the sanitized Markdown-generated HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This is currently being worked on priority To be fixed in priority
Projects
None yet
Development

No branches or pull requests

4 participants