Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-vm64-cfqx-3698

Опубликовано: 10 фев. 2022
Источник: github
Github: Прошло ревью
CVSS3: 7.2

Описание

Code Injection in jsen

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

const jsen = require('jsen'); let schema = JSON.parse( { "type": "object", "properties": { "username": { "type": "string" } }, "required": ["\\"+process.mainModule.require(\'child_process\').execSync(\'touch malicious\')+\\""] } ); const validate = jsen(schema); validate({});

Пакеты

Наименование

jsen

npm
Затронутые версииВерсия исправления

<= 0.6.6

Отсутствует

EPSS

Процентиль: 76%
0.0098
Низкий

7.2 High

CVSS3

Дефекты

CWE-94

Связанные уязвимости

CVSS3: 7.2
nvd
около 5 лет назад

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.

EPSS

Процентиль: 76%
0.0098
Низкий

7.2 High

CVSS3

Дефекты

CWE-94