9.4critical
Swiper has a Prototype Pollution Vulnerability
- Severity
- 9.4critical CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.54% (higher than 46% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hmx5-qpq5-p643
Description
Swiper is a free and mobile touch slider with hardware accelerated transitions and native behavior. Versions 6.5.1 through 12.1.1 have a Prototype pollution vulnerability. The vulnerability resides in line 94 of shared/utils.mjs, where the indexOf() function is used to check whether user provided input contain forbidden strings. Despite a previous fix that attempted to mitigate prototype pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using Array.prototype. The exploit works across Windows and Linux and on Node and Bun runtimes. Any application that processes attacker-controlled input using this package may be affected by the following: Authentication Bypass, Denial of Service and RCE. This issue is fixed in version 12.1.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| nolimits4web swiper | >= 6.5.1, < 12.1.2 | CVE List |
| swiper (npm) | from 6.5.1 before 12.1.2 | GitHub Advisory Database |
| swiperjs swiper | from 6.5.1 before 12.1.2 | NVD |
All scores
| GitHub_M | 9.4critical CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H |
| GitHub | critical CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
Swiper is a free and mobile touch slider with hardware accelerated transitions and native behavior. Versions 6.5.1 through 12.1.1 have a Prototype pollution vulnerability. The vulnerability resides in line 94 of shared/utils.mjs, where the indexOf() function is used to check whether user provided input contain forbidden strings. Despite a previous fix that attempted to mitigate prototype pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using Array.prototype. The exploit works across Windows and Linux and on Node and Bun runtimes. Any application that processes attacker-controlled input using this package may be affected by the following: Authentication Bypass, Denial of Service and RCE. This issue is fixed in version 12.1.2.
GitHub Advisory Database
Summary
A prototype pollution vulnerability exists in the the npm package swiper (>=6.5.1, < 12.1.2). Despite a previous fix that attempted to mitigate prototype pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using Array.prototype. The exploit works across Windows and Linux and on Node and Bun runtimes. This issue is fixed in version 12.1.2
Details
The vulnerability resides in line 94 of shared/utils.mjs where indexOf() function is used to check whether user provided input contain forbidden strings.
PoC
Steps to reproduce
- Install latest version of swiper using npm install
- Run the following code snippet:
var swiper = require('swiper');
Array.prototype.indexOf = () => -1;
let obj = {};
var malicious_payload = '{"__proto__":{"polluted":"yes"}}';
console.log({}.polluted);
swiper.default.extendDefaults(JSON.parse(malicious_payload));
console.log({}.polluted); // prints yes -> indicating that the patch was bypassed and prototype pollution occurred
Expected behavior
Prototype pollution should be prevented and {} should not gain new properties. This should be printed on the console:
undefined
undefined OR throw an Error
Actual behavior
Object.prototype is polluted This is printed on the console:
undefined
yes
Impact
This is a prototype pollution vulnerability, which can have severe security implications depending on how swiper is used by downstream applications. Any application that processes attacker-controlled input using this package may be affected. It could potentially lead to the following problems:
- Authentication bypass
- Denial of service - Even if an attacker is not able to exploit prototype pollution in swiper, if there is a prototype pollution within the project from other dependencies, modifying global
Array.prototype.indexOfproperty can result in crash when swiper.default.extendDefaults is called because swiper makes use of this global property. This can lead to Denial of Service. - Remote code execution (if polluted property is passed to sinks like eval or child_process)
Related CVEs
NVD (es)
Swiper es un deslizador táctil móvil y gratuito con transiciones aceleradas por hardware y comportamiento nativo. Las versiones 6.5.1 hasta 12.1.1 tienen una vulnerabilidad de contaminación de prototipos. La vulnerabilidad reside en la línea 94 de shared/utils.mjs, donde la función indexOf() se utiliza para verificar si la entrada proporcionada por el usuario contiene cadenas prohibidas. A pesar de una corrección anterior que intentó mitigar la contaminación de prototipos verificando si la entrada del usuario contenía una clave prohibida, todavía es posible contaminar Object.prototype a través de una entrada manipulada usando Array.prototype. El exploit funciona en Windows y Linux y en los entornos de ejecución de Node y Bun. Cualquier aplicación que procese entrada controlada por el atacante usando este paquete puede verse afectada por lo siguiente: Omisión de Autenticación, Denegación de Servicio y RCE. Este problema está solucionado en la versión 12.1.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27212 changed 2026-02-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hmx5-qpq5-p643 changed 2026-02-23 | CC-BY-4.0 |
| NVD | CVE-2026-27212 changed 2026-06-17 | Public domain |