Undesired Behavior Affecting sweetalert2 package, versions >=11.4.9


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Mature

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-SWEETALERT2-2774674
  • published 24 Apr 2022
  • disclosed 24 Apr 2022
  • credit Unknown

Introduced: 24 Apr 2022

CVE NOT AVAILABLE CWE-439 Open this link in a new tab

How to fix?

There is no fixed version for sweetalert2.

Overview

sweetalert2 is an accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert

Affected versions of this package are vulnerable to Undesired Behavior as it displays pop-up messages that affect Russian users when visiting Russian sites.

PoC:

 if (navigator.language === 'ru' && location.host.match(/\.(ru|su|xn--p1ai)$/)) {
    const noWar = document.createElement('div')
    noWar.className = swalClasses['no-war']
    setInnerHtml(
      noWar,
      `<a href="https://www.youtube.com/watch?v=${message.youtubeId}" target="_blank">${message.text}</a>`
    )
    container.appendChild(noWar)
    container.style.paddingTop = '4em'

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
3.7 low
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    Low
  • Availability (A)
    None