Code Injection

Affecting crossbow-lang package, ALL versions

Do your applications use this vulnerable package? Test your applications

Overview

crossbow-lang is an unmaintaned fork of dustjs-linkedin, a Javascript templating engine designed to run asynchronously on both the server and the browser. It is vulnerable to the same Code Injection vulnerability as Dust.js

Dust.js uses Javascript's eval() function to evaluate the "if" statement conditions. The input to the function is sanitized by escaping all potentially dangerous characters.

However, if the variable passed in is an array, no escaping is applied, exposing an easy path to code injection. The risk of exploit is especially high given the fact express, koa and many other Node.js servers allow users to force a query parameter to be an array using the param[]=value notation.

Remediation

Latest release (v1.0.0) is vulnerable, so we suggest to avoid using it altogether, until a patch is made available.

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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
CWE
CWE-95
Snyk ID
npm:crossbow-lang:20160819
Disclosed
09 Jan, 2015
Published
18 Sep, 2016