CVE-2022-36010

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-36010
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-36010.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-36010
Aliases
Published
2022-08-15T18:30:14Z
Modified
2025-11-28T04:50:24.558876Z
Severity
  • 10.0 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
Arbitrary code execution via function parsing in react-editable-json-tree
Details

This library allows strings to be parsed as functions and stored as a specialized component, <code>JsonFunctionValue</code>. To do this, Javascript's <code>eval</code> function is used to execute strings that begin with "function" as Javascript. This unfortunately could allow 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 <code>onSubmitValueParser</code> callback prop on the <code>JsonTree</code> component should be unaffected. This vulnerability exists in the default onSubmitValueParser prop which calls <code>parse</code>. Prop is added to JsonTree called allowFunctionEvaluation. This prop will be set to true in v2.2.2, which allows upgrade without losing backwards-compatibility. In v2.2.2, we switched from using eval to using <code>Function</code> to construct anonymous functions. This is better than eval for the following reasons: - Arbitrary code should not be able to execute immediately, since the Function constructor explicitly only creates anonymous functions - Functions are created without local closures, so they only have access to the global scope If you use: - Version &lt;2.2.2, you must upgrade as soon as possible. - Version ^2.2.2, you must explicitly set JsonTree's allowFunctionEvaluation prop to false to fully mitigate this vulnerability. - Version >=3.0.0, allowFunctionEvaluation is already set to false by default, so no further steps are necessary.

Database specific
{
    "cna_assigner": "GitHub_M",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/36xxx/CVE-2022-36010.json",
    "cwe_ids": [
        "CWE-95"
    ]
}
References

Affected packages

Git / github.com/oxyno-zeta/react-editable-json-tree

Affected ranges

Type
GIT
Repo
https://github.com/oxyno-zeta/react-editable-json-tree
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

1.*

1.2.0
1.3.0
1.3.1
1.4.0
1.5.0
1.6.0
1.7.0

2.*

2.0.0
2.1.0
2.2.0
2.2.1

v1.*

v1.0.0
v1.0.1
v1.1.0