Arbitrary Code Injection Affecting org.webjars.npm:underscore package, versions [0,1.13.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    1.53% (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 ID SNYK-JAVA-ORGWEBJARSNPM-1081503
  • published 29 Mar 2021
  • disclosed 2 Mar 2021
  • credit Alessio Della Libera (@d3lla)

How to fix?

Upgrade org.webjars.npm:underscore to version 1.13.1 or higher.

Overview

org.webjars.npm:underscore is a JavaScript's functional programming helper library.

Affected versions of this package are vulnerable to Arbitrary Code Injection via the template function, particularly when the variable option is taken from _.templateSettings as it is not sanitized.

PoC

const _ = require('underscore');
_.templateSettings.variable = "a = this.process.mainModule.require('child_process').execSync('touch HELLO')";
const t = _.template("")();

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
5.5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    High
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    Low
  • Availability (A)
    Low
Expand this section

NVD

7.2 high
Expand this section

Red Hat

7.2 high