{"answers":{"affected":"2 open source packages ship an affected version, including react-editable-json-tree. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36010 exists.","fix":"Upgrade react-editable-json-tree to 2.2.2 or later.","what":"CVE-2022-36010 is a critical code injection vulnerability in oxyno-zeta react-editable-json-tree, published on 15 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-36010 and fix it if it is affected.\n\nWhat it is: CVE-2022-36010 is a critical code injection vulnerability in oxyno-zeta react-editable-json-tree, published on 15 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36010 exists.\n\nAffected packages and fixed versions:\n- react-editable-json-tree (npm): affected all versions; fixed in 2.2.2\n- react-editable-json-tree (npm): affected all versions; fixed in 2.2.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-36010/ (Markdown: https://insights.sbomify.com/CVE-2022-36010/index.md)","id":"CVE-2022-36010","markdown":"https://insights.sbomify.com/CVE-2022-36010/index.md","name":"CVE-2022-36010","record":{"aliases":["GHSA-j3rv-w43q-f9x2"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"React JSON tree library","requires_auth":"none","summary":"Attackers can execute arbitrary code via eval in react-editable-json-tree when displaying untrusted JSON data.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"react_editable_json_tree","vendor":"react_editable_json_tree_project"}],"cvss":{"score":10,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-95","name":"Improper Neutralization of Directives in Dynamically Evaluated Code"}],"description":"This library allows strings to be parsed as functions and stored as a specialized component, [`JsonFunctionValue`](https://github.com/oxyno-zeta/react-editable-json-tree/blob/09a0ca97835b0834ad054563e2fddc6f22bc5d8c/src/components/JsonFunctionValue.js). To do this, Javascript's [`eval`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) 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 [`onSubmitValueParser`](https://github.com/oxyno-zeta/react-editable-json-tree/tree/09a0ca97835b0834ad054563e2fddc6f22bc5d8c#onsubmitvalueparser) callback prop on the [`JsonTree`](https://github.com/oxyno-zeta/react-editable-json-tree/blob/09a0ca97835b0834ad054563e2fddc6f22bc5d8c/src/JsonTree.js) component should be ***unaffected***. This vulnerability exists in the default `onSubmitValueParser` prop which calls [`parse`](https://github.com/oxyno-zeta/react-editable-json-tree/blob/master/src/utils/parse.js#L30). 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 [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/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 `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 `\u003c2.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 `\u003e=3.0.0`**, `allowFunctionEvaluation` is already set to `false` by default, so no further steps are necessary.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Arbitrary code execution via function parsing in react-editable-json-tree","id":"CVE-2022-36010","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"code_injection","year":"2022"},"n_packages":2,"n_references":2,"next":{"headline":"Null dereference on MLIR on empty function attributes in TensorFlow","id":"CVE-2022-36011"},"packages":[{"ecosystem":"npm","fixed":["2.2.2"],"introduced":["0"],"last_affected":[],"package":"react-editable-json-tree","purl":null,"source":"GHSA-j3rv-w43q-f9x2"},{"ecosystem":"npm","fixed":["2.2.2"],"introduced":["0"],"last_affected":[],"package":"react-editable-json-tree","purl":"pkg:npm/react-editable-json-tree","source":"GHSA-j3rv-w43q-f9x2"}],"prev":{"headline":"Incorrect parsing of access level in gomatrixserverlib and dendrite","id":"CVE-2022-36009"},"products":["react-editable-json-tree"],"published":"2022-08-15","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["oxyno-zeta"]},"summary":"Attackers can execute arbitrary code via eval in react-editable-json-tree when displaying untrusted JSON data.","url":"https://insights.sbomify.com/CVE-2022-36010/"}