SQL Injection Affecting squel package, versions *


0.0
medium

Snyk CVSS

    Attack Complexity Low

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 npm:squel:20180322
  • published 9 May 2018
  • disclosed 22 Mar 2018
  • credit Sean Lynch

Introduced: 22 Mar 2018

CVE NOT AVAILABLE CWE-89 Open this link in a new tab

How to fix?

There is no fix version for squel.

Overview

squel is a SQL query string builder.

Affected versions of this package are vulnerable to SQL Injection. The package does not properly escape user provided input when provided using the setFields method. This could lead to sql injection if the query was then executed.

Proof of concept demonstrating the injection of a single quote into a generated sql statement from user provided input.

> console.log(squel.insert().into('buh').setFields({foo: "bar'baz"}).toString());
INSERT INTO buh (foo) VALUES ('bar\'baz')

References