Security mailing lists by PureSourceCode

GHSA-4qhx-g9wp-g9m6

CRITICAL

Failure to sanitize quotes which can lead to sql injection in squel

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.

Published
14 Jun 2019
Last modified
16 Sep 2021
Weakness
CWE-74CWE-89
Sources
OSVJSON

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV npm squel <= 5.13.0

References

History

  • 25 Nov 2026 20:10 UTC · OSV: first stored (published 14 Jun 2019)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.