Prototype pollution in swiper
CVE-2026-27212 · GHSA-hmx5-qpq5-p643
- Affected
- npm swiper >= 6.5.1, < 12.1.2
- Fixed in
- 12.1.2· Vendor fix available
- Issue
- 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: Expected behavior Prototype pollution should be prevented and {} should not gain new properties. This should be printed on the console: Actual behavior Object.prototype is polluted This is printed on the console: Impact This is a prototype pollution vulnerability, which can have severe…
Recommended action: Upgrade to 12.1.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.