GHSA-JR3J-WHM4-9WWM

Vulnerability from github – Published: 2021-06-04 19:10 – Updated: 2021-06-07 18:54
VLAI?
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.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "auth0-lock"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "11.30.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-32641"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-06-04T18:28:08Z",
    "nvd_published_at": "2021-06-04T21:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Overview\n\nVersions before and including `11.30.0` are vulnerable to reflected XSS.  An attacker can execute arbitrary code when the library\u0027s\n- `flashMessage` feature is utilized and user input or data from URL parameters is incorporated into the `flashMessage`.\n- `languageDictionary` feature is utilized and user input or data from URL parameters is incorporated into the `languageDictionary`.\n\n### Am I affected?\nYou are affected by this vulnerability if you are using `auth0-lock` version `11.30.0` or lower and all of the following conditions apply:\n\n- You are utilizing `flashMessage` feature.\n- User input or data from URL parameters is incorporated into the `flashMessage`.\n\nAn example of a vulnerable snippet where query parameters are used to populate the `text` property of a `flashMessage`.\n```js\nvar params = new URLSearchParams(location.search);\nvar errorMessage = params.get(\u0027error__message\u0027);\nvar showParams = {};\n\nif (!!errorMessage === true) {\n  showParams.flashMessage = {\n    type: \u0027error\u0027,\n    text: \u0027We were unable to log you in. \u0027 + errorMessage,\n  };\n}\n\nlock.show(showParams);\n```\n\nOR\n\n- You are utilizing `languageDictionary` feature.\n- User input or data from URL parameters is used in `languageDictionary` properties.\n\nAn example of a vulnerable snippet where query parameters are used to populate the `socialLoginInstructions` property of a `languageDictionary`.\n```js\nvar params = new URLSearchParams(location.search);\nvar instruction = params.get(\u0027instruction\u0027);\n\nvar options = {\n  languageDictionary: {\n    emailInputPlaceholder: \"something@youremail.com\",\n    title: \"title\",\n    socialLoginInstructions: instruction\n  },\n};\n\nvar lock = new Auth0LockPasswordless(\n    CLIENT_ID,\n    DOMAIN,\n    options\n);\n\nlock.show()\n```\n\n### How to fix that?\nUpgrade to version `11.30.1`.\n\n### Will this update impact my users?\nThe fix uses [DOMPurify](https://github.com/cure53/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.",
  "id": "GHSA-jr3j-whm4-9wwm",
  "modified": "2021-06-07T18:54:43Z",
  "published": "2021-06-04T19:10:34Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/auth0/lock/security/advisories/GHSA-jr3j-whm4-9wwm"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32641"
    },
    {
      "type": "WEB",
      "url": "https://github.com/auth0/lock/commit/d139cf01c8234b07caf265e051f39d3eab08f7ed"
    },
    {
      "type": "WEB",
      "url": "https://github.com/auth0/lock/releases/tag/v11.30.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Reflected XSS when using flashMessages or languageDictionary"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…