SQL Injection Affecting squel package, versions *


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

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

CVSS Scores

version 3.1
Expand this section

Snyk

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