GHSA-jr3j-whm4-9wwm

Suggest an improvement
Source
https://github.com/advisories/GHSA-jr3j-whm4-9wwm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/06/GHSA-jr3j-whm4-9wwm/GHSA-jr3j-whm4-9wwm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-jr3j-whm4-9wwm
Aliases
Related
Published
2021-06-04T19:10:34Z
Modified
2023-11-08T04:05:55.425885Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Reflected XSS when using flashMessages or languageDictionary
Details

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: "something@youremail.com",
    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.

Database specific
{
    "nvd_published_at": "2021-06-04T21:15:00Z",
    "github_reviewed_at": "2021-06-04T18:28:08Z",
    "severity": "HIGH",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-79"
    ]
}
References

Affected packages

npm / auth0-lock

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
11.30.1