René Helmke 7791f18b51 bootstrap
2023-05-16 16:09:41 +02:00

119 lines
7.8 KiB
JSON

{
"id": "CVE-2022-36010",
"sourceIdentifier": "security-advisories@github.com",
"published": "2022-08-15T19:15:09.207",
"lastModified": "2022-08-16T17:47:20.713",
"vulnStatus": "Analyzed",
"descriptions": [
{
"lang": "en",
"value": "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 `<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."
},
{
"lang": "es",
"value": "Esta biblioteca permite que las cadenas sean analizadas como funciones y almacenadas como un componente especializado, [\"JsonFunctionValue\"](https://github.com/oxyno-zeta/react-editable-json-tree/blob/09a0ca97835b0834ad054563e2fddc6f22bc5d8c/src/components/JsonFunctionValue.js). Para ello, es usada la funci\u00f3n [\"eval\"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) de Javascript para ejecutar las cadenas que empiezan por \"function\" como Javascript. Lamentablemente, esto podr\u00eda permitir una ejecuci\u00f3n de c\u00f3digo arbitrario si se presenta como valor dentro de la estructura JSON que est\u00e1 siendo mostrada. Dado que este componente puede ser usado a menudo para mostrar datos de fuentes arbitrarias y no confiables, esto es extremadamente peligroso. Una nota importante es que los usuarios que han definido una devoluci\u00f3n de llamada personalizada [\"onSubmitValueParser\"](https://github.com/oxyno-zeta/react-editable-json-tree/tree/09a0ca97835b0834ad054563e2fddc6f22bc5d8c#onsubmitvalueparser) en el componente [\"JsonTree\"](https://github.com/oxyno-zeta/react-editable-json-tree/blob/09a0ca97835b0834ad054563e2fddc6f22bc5d8c/src/JsonTree.js) deber\u00edan estar ***no afectados***. Esta vulnerabilidad se presenta en la proposici\u00f3n por defecto \"onSubmitValueParser\" que llama a [\"parse\"](https://github.com/oxyno-zeta/react-editable-json-tree/blob/master/src/utils/parse.js#L30). Es a\u00f1adida una propiedad a \"JsonTree\" llamada \"allowFunctionEvaluation\". Esta proposici\u00f3n ser\u00e1 establecida como \"true\" en versi\u00f3n v2.2.2, lo que permite la actualizaci\u00f3n sin perder la retrocompatibilidad. En versi\u00f3n v2.2.2, pasamos de usar \"eval\" a usar [\"Function\"](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) para construir funciones an\u00f3nimas. Esto es mejor que \"eval\" por las siguientes razones: - El c\u00f3digo arbitrario no deber\u00eda poder ejecutarse inmediatamente, ya que el constructor \"Function\" expl\u00edcitamente *s\u00f3lo crea* funciones an\u00f3nimas - Las funciones son creadas sin cierres locales, por lo que s\u00f3lo presentan acceso al \u00e1mbito global Si usa: - **Versi\u00f3n \"&lt;2.2.2\"**, debe actualizar cuanto antes. - Si usa: **Versi\u00f3n \"^2.2.2\"**, debe establecer expl\u00edcitamente la propiedad \"allowFunctionEvaluation\" de \"JsonTree\" a \"false\" para mitigar completamente esta vulnerabilidad. - En las versiones anteriores a \"3.0.0 incluy\u00e9ndola\"**, \"allowFunctionEvaluation\" ya est\u00e1 configurado por defecto a \"false\", por lo que no es necesario realizar ning\u00fan otro paso."
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "nvd@nist.gov",
"type": "Primary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 9.8,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 5.9
},
{
"source": "security-advisories@github.com",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "NONE",
"scope": "CHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 10.0,
"baseSeverity": "CRITICAL"
},
"exploitabilityScore": 3.9,
"impactScore": 6.0
}
]
},
"weaknesses": [
{
"source": "nvd@nist.gov",
"type": "Primary",
"description": [
{
"lang": "en",
"value": "NVD-CWE-noinfo"
}
]
},
{
"source": "security-advisories@github.com",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-95"
}
]
}
],
"configurations": [
{
"nodes": [
{
"operator": "OR",
"negate": false,
"cpeMatch": [
{
"vulnerable": true,
"criteria": "cpe:2.3:a:react_editable_json_tree_project:react_editable_json_tree:*:*:*:*:*:node.js:*:*",
"versionEndExcluding": "2.2.2",
"matchCriteriaId": "1D973F77-335F-4ECC-B5A9-DAA23747CA33"
}
]
}
]
}
],
"references": [
{
"url": "https://github.com/oxyno-zeta/react-editable-json-tree/releases/tag/2.2.2",
"source": "security-advisories@github.com",
"tags": [
"Release Notes",
"Third Party Advisory"
]
},
{
"url": "https://github.com/oxyno-zeta/react-editable-json-tree/security/advisories/GHSA-j3rv-w43q-f9x2",
"source": "security-advisories@github.com",
"tags": [
"Exploit",
"Third Party Advisory"
]
}
]
}