What’s Vulnerable › Vulnerabilities

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

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.

Affected products

How to fix

Upgrade to a fixed version: ecomfe zrender 5.2.1. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2021-39227 or the next vulnerability affects your stack