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

Security Fix for Stored-XSS on "ChatCord" - huntr.dev #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

huntr-helper
Copy link

https://huntr.dev/users/alromh87 has fixed the Stored-XSS on "ChatCord" vulnerability 🔨. alromh87 has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 💵. Think you could fix a vulnerability like this?

Get involved at https://huntr.dev/

Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#1
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/other/chatcord/1/README.md

User Comments:

📊 Metadata *

Bounty URL: https://www.huntr.dev/bounties/1-other-chatcord

⚙️ Description *

There is no proper sanitization of some data received from server making code injection available to malicious user, if traffic is intercepted and modified.

💻 Technical Description *

Fixed by replacing the use of innerHTML() for innerText() efectively treating incoming data as text and not html elements.

🐛 Proof of Concept (PoC) *

  1. Download the project
  2. Run npm i
  3. Run npm run dev
  4. Go on http://localhost:3000 or on the Repl instance created
  5. Go on https://instance:port/chat.html?username=test&room=JavaScript
  6. Start Burp
  7. Send a new message and intercept the WS request
  8. Modify the time parameter in ><img/src="x"/onerror=alert(1)>
    XSS triggered !!!

Captura de pantalla de 2020-09-08 10-30-26

Proof of Fix (PoF) *

After fix data is treated as text and No code is executed for remote user

Captura de pantalla de 2020-09-08 10-28-32

👍 User Acceptance Testing (UAT)

After fix functionality is unafected

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 this pull request may close these issues.

3 participants