Intel

AIKIDO-2025-10318

swiper is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published May 21, 2025

28

Low Risk

This Affects:

jsswiper
10.0.0 - 11.2.6
Fixed in 11.2.7
Are you affected? Scan for Free

TL;DR

Affected versions of this package do not support the TrustedTypes API, which is designed to prevent DOM-based injection attacks such as Cross-Site Scripting (XSS). When used in environments enforcing TrustedTypes, Swiper.js fails to wrap dynamic HTML assignments with innerHTML. An attacker could exploit this by injecting malicious payloads into Swiper-controlled elements (e.g., slides, pagination, or navigation) if the application passes unsanitized user input to Swiper's initialization or content methods, effectively bypassing protections and enabling XSS attacks.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

swiper is vulnerable to Cross-site Scripting (XSS) in versions 10.0.0 - 11.2.6.

How to fix this

Upgrade the swiper library to a patch version.