Advisory

GHSA-4qhx-g9wp-g9m6

Also known as: None

Summary

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

Details

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.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2019-06-14 16:09 UTC
Modified
2021-09-16 21:00 UTC

Affected packages and fixes

squel

npm · All systems

Affected

  • introduced 0, last affected 5.13.0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences