SQL Injection Affecting squel package, versions *


Severity

Recommended
0.0
medium
0
10

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

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 SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDnpm:squel:20180322
  • published9 May 2018
  • disclosed22 Mar 2018
  • creditSean Lynch

Introduced: 22 Mar 2018

CVE NOT AVAILABLE CWE-89  (opens 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

CVSS Scores

version 3.1