# sweetalert2 undesirable behavior on specific TLDs

Source: https://junglewise.ai/threats/sweetalert2-undesirable-behavior-on-specific-tlds-fd4b5ac4  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-07-10. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2023-07-10

sweetalert2 is a popular JavaScript library for displaying alert dialogs and notifications in web applications. Versions 11.6.14 to 11.22.3 contained code that played audio or video messages unrelated to the library's core functionality when users accessed websites from certain country-specific domain extensions. This "protestware" behavior could interrupt user experience and distract from the application's normal operations.

Technologies: [sweetalert2 (npm)](https://junglewise.ai/threats/technologies/sweetalert2). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 10 July 2023.

**Which products and versions are affected?** sweetalert2 (npm) SEMVER:introduced=11.6.14,fixed=11.22.4.

**Is there a fix for This vulnerability?** Yes. sweetalert2 (npm): upgrade to 11.22.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** Check whether you run sweetalert2 (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- sweetalert2 (npm): upgrade to 11.22.4 or later

  ```sh
  npm install sweetalert2@11.22.4
  ```


## Technical details

The vulnerability (CWE-440: Unexpected Behavior) involves undesirable and undocumented code execution triggered by domain suffix matching. Specifically, the library would play audio/video messages unrelated to its alert dialog functionality when accessed from certain TLDs (.ru, .su, .рф). This behavior was triggered automatically on specific domains without user consent or clear application purpose, effectively injecting disruptive content into applications using the library. The issue affected versions 11.6.14 through 11.22.3 and was patched in 11.22.4 by removing the problematic code entirely.

## Affected products

- sweetalert2 sweetalert2 11.6.14 to before 11.22.4

## Timeline

- 2023-07-10: disclosed
- 2025-08-14: patched

## References

- [https://github.com/sweetalert2/sweetalert2/pull/2847](https://github.com/sweetalert2/sweetalert2/pull/2847)
- [https://github.com/sweetalert2/sweetalert2/commit/7de85db5c76ba3ef5f0cdbc335bbc4a7c559e012](https://github.com/sweetalert2/sweetalert2/commit/7de85db5c76ba3ef5f0cdbc335bbc4a7c559e012)

## Related threats

- [sweetalert2 hidden functionality and protestware](https://junglewise.ai/threats/sweetalert2-hidden-functionality-and-protestware-03d50cb7)
- [sweetalert2 hidden functionality in versions 9.17.4 through 10.0.0](https://junglewise.ai/threats/sweetalert2-hidden-functionality-in-versions-9-17-4-through-10-0-0-c94c7cec)
- [sweetalert2 hidden functionality in alert dialogs](https://junglewise.ai/threats/sweetalert2-hidden-functionality-in-alert-dialogs-5fc44f4d)
- [sweetalert2 hidden functionality in package initialization](https://junglewise.ai/threats/sweetalert2-hidden-functionality-in-package-initialization-f7a140e3)
