Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLTRxaHgtZzl3cC1nOW02
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.
Permalink: https://github.com/advisories/GHSA-4qhx-g9wp-g9m6JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLTRxaHgtZzl3cC1nOW02
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: over 5 years ago
Updated: almost 2 years ago
Identifiers: GHSA-4qhx-g9wp-g9m6
References:
- https://github.com/hiddentao/squel/issues/350
- https://www.npmjs.com/advisories/575
- https://github.com/advisories/GHSA-4qhx-g9wp-g9m6
Blast Radius: 0.0
Affected Packages
npm:squel
Dependent packages: 155Dependent repositories: 475
Downloads: 62,466 last month
Affected Version Ranges: <= 5.13.0
No known fixed version
All affected versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.0.6, 1.0.7, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.2.0, 1.2.1, 2.0.0, 3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.3.0, 3.4.0, 3.4.1, 3.4.2, 3.5.0, 3.6.0, 3.6.1, 3.7.0, 3.8.1, 3.9.0, 3.9.1, 3.10.0, 4.0.0, 4.1.0, 4.1.1, 4.2.0, 4.2.2, 4.2.3, 4.2.4, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.4.0, 4.4.1, 4.4.2, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.5.0, 5.5.1, 5.6.0, 5.7.0, 5.8.0, 5.9.0, 5.9.1, 5.10.0, 5.10.1, 5.11.0, 5.11.1, 5.12.0, 5.12.1, 5.12.2, 5.13.0