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.
Remediation
References
https://github.com/bugventure/jsen/blob/master/lib/jsen.js%23L875
https://snyk.io/vuln/SNYK-JS-JSEN-1014670
Related Vulnerabilities
CVE-2020-13920 Vulnerability in maven package org.apache.activemq:activemq-core
CVE-2023-32007 Vulnerability in maven package org.apache.spark:spark-core_2.13
CVE-2022-39353 Vulnerability in npm package xmldom
CVE-2021-32831 Vulnerability in npm package total.js
CVE-2022-25857 Vulnerability in maven package org.yaml:snakeyaml