Summary
React Editable Json Tree vulnerable to arbitrary code execution via function parsing
Workarounds
As mentioned above, there are a few scenarios you must consider:
If you use:
- Version
<2.2.2, you must upgrade as soon as possible. - Version
^2.2.2, you must explicitly setJsonTree'sallowFunctionEvaluationprop tofalseto fully mitigate this vulnerability. - Version
>=3.0.0,allowFunctionEvaluationis already set tofalseby default, so no further steps are necessary.
References
None.
For more information
If you have any questions or comments about this advisory:
- Open an issue in the GitHub repo
Impact
Our library allows strings to be parsed as functions and stored as a specialized component, JsonFunctionValue. To do this, Javascript's eval function was used to execute strings that begin with "function" as Javascript. This was an oversight that unfortunately allows arbitrary code to be executed if it exists as a value within the JSON structure being displayed. Given that this component may often be used to display data from arbitrary, untrusted sources, this is extremely dangerous.
One important note is that users who have defined a custom onSubmitValueParser callback prop on the JsonTree component should be unaffected. This vulnerability exists in the default onSubmitValueParser prop which calls parse.
CVE-2022-36010 has a CVSS score of 10.0 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.2.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
We have decided on a two-pronged approach to patching this vulnerability:
- Create a patch update that adds a workaround which is not enabled by default to preserve backwards-compatibility
- On the next major update, we will enable this workaround by default
The workaround we have decided on is adding a prop to JsonTree called allowFunctionEvaluation. This prop will be set to true in v2.2.2, so you can upgrade without fear of losing backwards-compatibility.
We have also implemented additional security measures as we know many people may not read the details of this vulnerability, and we want to do the best we can to keep you protected. In v2.2.2, we switched from using eval to using Function to construct anonymous functions. This is better than eval for the following reasons:
- Arbitrary code should not be able to execute immediately, since the
Functionconstructor explicitly only creates anonymous functions - Functions are created without local closures, so they only have access to the global scope
This change has brought a slight potential for breaking backwards-compatibility if users for some reason were relying on side-effects of our usage of eval, but that is beyond intended behavior, so we have decided to go ahead with this change and consider it a non-breaking change.
Frequently Asked Questions
- What is CVE-2022-36010? CVE-2022-36010 is a critical-severity security vulnerability in react-editable-json-tree (npm), affecting versions < 2.2.2. It is fixed in 2.2.2.
- How severe is CVE-2022-36010? CVE-2022-36010 has a CVSS score of 10.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of react-editable-json-tree are affected by CVE-2022-36010? react-editable-json-tree (npm) versions < 2.2.2 is affected.
- Is there a fix for CVE-2022-36010? Yes. CVE-2022-36010 is fixed in 2.2.2. Upgrade to this version or later.
- Is CVE-2022-36010 exploitable, and should I be worried? Whether CVE-2022-36010 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2022-36010 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2022-36010? Upgrade
react-editable-json-treeto 2.2.2 or later.