Code Injection in jsen
High severity
GitHub Reviewed
Published
Feb 10, 2022
to the GitHub Advisory Database
•
Updated Sep 11, 2023
Description
Published by the National Vulnerability Database
Nov 23, 2020
Reviewed
Apr 14, 2021
Published to the GitHub Advisory Database
Feb 10, 2022
Last updated
Sep 11, 2023
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.PoC
References