Lucene search

K
githubGitHub Advisory DatabaseGHSA-JR3J-WHM4-9WWM
HistoryJun 04, 2021 - 7:10 p.m.

Reflected XSS when using flashMessages or languageDictionary

2021-06-0419:10:34
CWE-79
GitHub Advisory Database
github.com
193
reflected xss
vulnerable versions
auth0-lock
flashmessage
languagedictionary
user input
url parameters
upgrade
dompurify

CVSS2

4.3

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

CVSS3

8.1

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS

0.001

Percentile

45.5%

Overview

Versions before and including 11.30.0 are vulnerable to reflected XSS. An attacker can execute arbitrary code when the library’s

  • flashMessage feature is utilized and user input or data from URL parameters is incorporated into the flashMessage.
  • languageDictionary feature is utilized and user input or data from URL parameters is incorporated into the languageDictionary.

Am I affected?

You are affected by this vulnerability if you are using auth0-lock version 11.30.0 or lower and all of the following conditions apply:

  • You are utilizing flashMessage feature.
  • User input or data from URL parameters is incorporated into the flashMessage.

An example of a vulnerable snippet where query parameters are used to populate the text property of a flashMessage.

var params = new URLSearchParams(location.search);
var errorMessage = params.get('error__message');
var showParams = {};

if (!!errorMessage === true) {
  showParams.flashMessage = {
    type: 'error',
    text: 'We were unable to log you in. ' + errorMessage,
  };
}

lock.show(showParams);

OR

  • You are utilizing languageDictionary feature.
  • User input or data from URL parameters is used in languageDictionary properties.

An example of a vulnerable snippet where query parameters are used to populate the socialLoginInstructions property of a languageDictionary.

var params = new URLSearchParams(location.search);
var instruction = params.get('instruction');

var options = {
  languageDictionary: {
    emailInputPlaceholder: "[email protected]",
    title: "title",
    socialLoginInstructions: instruction
  },
};

var lock = new Auth0LockPasswordless(
    CLIENT_ID,
    DOMAIN,
    options
);

lock.show()

How to fix that?

Upgrade to version 11.30.1.

Will this update impact my users?

The fix uses DOMPurify to sanitise the flashMessage and languageDictionary inputs. If you are including inline JavaScript in these fields, like script tags or onclick attributes, these will be removed.

Affected configurations

Vulners
Node
auth0lockRange<11.30.1
VendorProductVersionCPE
auth0lock*cpe:2.3:a:auth0:lock:*:*:*:*:*:*:*:*

CVSS2

4.3

Attack Vector

NETWORK

Attack Complexity

MEDIUM

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

AV:N/AC:M/Au:N/C:N/I:P/A:N

CVSS3

8.1

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS

0.001

Percentile

45.5%

Related for GHSA-JR3J-WHM4-9WWM