GitHub Advisoryadvisory · npm

GHSA-hmx5-qpq5-p643 Prototype pollution in swiper

CRITICAL Published 2026-02-19 Modified 2026-02-23 Official page ↗
Aliases
CVE-2026-27212
Ecosystem
npm
Packages
swiper
Severity
Critical
CVSS vector
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
Weaknesses
CWE-1321
Reviewed
2026-02-19

Affected packages

• npm swiper: >= 6.5.1, < 12.1.2 → fixed in 12.1.2

Description

Summary A prototype pollution vulnerability exists in the the npm package swiper (>=6.5.1, -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

Related

Alias · CVE (1)

  • CVE-2026-27212 Swiper is a free and mobile touch slider with hardware accelerated transitions and native behavior. vulnerability

Weakness · CWE (1)

  • CWE-1321 Improperly Controlled Modification of Object Prototype Attributes weakness

References