Skip to content

Converse.js fails if passwords contain an & #3299

@GonzaloSpurr

Description

@GonzaloSpurr

Describe the bug
When trying to log in to a pre-existing account, or generate a new one: if the password contains an ampersand (&) it will fail.

To Reproduce
Steps to reproduce the behavior:
0. Have an XMPP account whose password contains an ampersand

  1. Go to 'conversejs.org/fullscreen.html'
  2. Put in your XMPP address
  3. Type in your password (which must contain an ampersand)
  4. See authentication error

Expected behavior
converse.js should be able to properly escape ampersands in password fields.

Screenshots
Error when loggin in:
Authentication failure. Your XMPP address and/or password is incorrect. Please try again.

Copy of the error log when making an account:

stanza.js:10 Uncaught Error: Parser Error: <field var="password"><value>@t9dzMJ.43zEzqPN!D#&cMytH&3^U)gE</value></field>
    at Object.$c [as toStanza] (stanza.js:10:15)
    at I$ (form.js:33:14)
    at panel.js:346:47
    at Array.map (<anonymous>)
    at Gy.submitRegistrationForm (panel.js:346:38)
    at Gy.onFormSubmission (panel.js:172:18)
    at Gy.<anonymous> (registration_form.js:13:79)
    at ph.handleEvent (lit-html.ts:2010:29)

Environment (please complete the following information):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions