Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. squel
  4. ›
  5. GMS-2019-58

GMS-2019-58: Failure to sanitize quotes which can lead to sql injection in squel

June 14, 2019 (updated September 16, 2021)

All versions of squel are vulnerable to sql injection.

The squel 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')
``` ## Recommendation

There is no fix at this time and the issue has been reported publicly. Consider using another query builder that provides strong guarantees for input sanitization to prevent sql injection attacks.

References

  • github.com/advisories/GHSA-4qhx-g9wp-g9m6
  • github.com/hiddentao/squel/issues/350
  • www.npmjs.com/advisories/575

Code Behaviors & Features

Detect and mitigate GMS-2019-58 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 5.13.0

Solution

Unfortunately, there is no solution available yet.

Source file

npm/squel/GMS-2019-58.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:11 +0000.