{"id":"CVE-2020-7777","aliases":["EUVD-2022-1210","GHSA-vm64-cfqx-3698"],"status":"published","title":"Arbitrary Code Execution","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so I assume that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a Function.apply();, leading to an Arbitrary Code Execution.","severity":{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H/E:P/RL:U/RC:C","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.02114,"percentile":0.82063,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-94"],"published":"2020-11-23T15:40:15Z","modified":"2026-06-17T03:25:25Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"jsen","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.6.6"}]}]},{"source":"osv","ecosystem":"npm","package":"jsen","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.6.6"}]}]}],"products":[{"vendor":"jsen_project","product":"jsen"}],"references":[{"url":"https://snyk.io/vuln/SNYK-JS-JSEN-1014670","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory"]},{"url":"https://github.com/bugventure/jsen/blob/master/lib/jsen.js%23L875","tags":["x_refsource_MISC","x_transferred","Broken Link"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-7777","tags":["advisory"]},{"url":"https://github.com/bugventure/jsen/blob/master/lib/jsen.js#L875","tags":["web"]},{"url":"https://security.snyk.io/vuln/SNYK-JS-JSEN-1014670","tags":["web"]},{"url":"https://github.com/advisories/GHSA-vm64-cfqx-3698"}],"sources":{"cve":[{"id":"CVE-2020-7777","title":"Arbitrary Code Execution","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so I assume that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a Function.apply();, leading to an Arbitrary Code Execution.","status":"published","published":"2020-11-23T15:40:15.585Z","modified":"2024-09-17T01:01:16.176Z","cvss":[{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H/E:P/RL:U/RC:C","level":"high","assessor":"cna"}],"updated_at":"2026-11-02T14:35:58.787905Z"}],"euvd":[{"id":"EUVD-2022-1210","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so I assume that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a Function.apply();, leading to an Arbitrary Code Execution.","status":"published","published":"2020-11-23T15:40:15Z","modified":"2024-09-17T01:01:16Z","cvss":[{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H/E:P/RL:U/RC:C","level":"high"}],"updated_at":"2026-11-03T00:28:53.686001Z"}],"ghsa":[{"id":"GHSA-vm64-cfqx-3698","title":"Code Injection in jsen","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so it is assumed that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a `Function.apply();`, leading to an Arbitrary Code Execution.\n\n### PoC\n```js\nconst jsen = require('jsen');\nlet schema = JSON.parse(\n{ \u0026quot;type\u0026quot;: \u0026quot;object\u0026quot;, \u0026quot;properties\u0026quot;: { \u0026quot;username\u0026quot;: { \u0026quot;type\u0026quot;: \u0026quot;string\u0026quot; } }, \u0026quot;required\u0026quot;: [\u0026quot;\\\\\u0026quot;+process.mainModule.require(\\\u0026#39;child_process\\\u0026#39;).execSync(\\\u0026#39;touch malicious\\\u0026#39;)+\\\\\u0026quot;\u0026quot;] }\n);\n\nconst validate = jsen(schema); validate({});\n```","status":"published","published":"2022-02-10T20:18:37Z","modified":"2023-09-11T23:08:53Z","cvss":[{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:37:04.447845Z"}],"nvd":[{"id":"CVE-2020-7777","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so I assume that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a Function.apply();, leading to an Arbitrary Code Execution.","status":"published","published":"2020-11-23T16:15:13.603Z","modified":"2026-06-17T03:25:25.72Z","cvss":[{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"2.0","score":6.5,"vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"updated_at":"2026-11-02T14:06:25.394006Z"}],"osv":[{"id":"GHSA-vm64-cfqx-3698","title":"Code Injection in jsen","description":"This affects all versions of package jsen. If an attacker can control the schema file, it could run arbitrary JavaScript code on the victim machine. In the module description and README file there is no mention about the risks of untrusted schema files, so it is assumed that this is applicable. In particular the required field of the schema is not properly sanitized. The resulting string that is build based on the schema definition is then passed to a `Function.apply();`, leading to an Arbitrary Code Execution.\n\n### PoC\n```js\nconst jsen = require('jsen');\nlet schema = JSON.parse(\n{ \u0026quot;type\u0026quot;: \u0026quot;object\u0026quot;, \u0026quot;properties\u0026quot;: { \u0026quot;username\u0026quot;: { \u0026quot;type\u0026quot;: \u0026quot;string\u0026quot; } }, \u0026quot;required\u0026quot;: [\u0026quot;\\\\\u0026quot;+process.mainModule.require(\\\u0026#39;child_process\\\u0026#39;).execSync(\\\u0026#39;touch malicious\\\u0026#39;)+\\\\\u0026quot;\u0026quot;] }\n);\n\nconst validate = jsen(schema); validate({});\n```","status":"published","published":"2022-02-10T20:18:37Z","modified":"2023-11-08T04:04:09.974138Z","cvss":[{"version":"3.1","score":7.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:46:57.348035Z"}]}}
