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.
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | squel | <= 5.13.0 | keine Korrektur |
Verweise
- Schwäche (CWE)
CWE-74, CWE-89- Plattform
- npm
- Paket
squel- Veröffentlicht
- 14.06.2019
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-4qhx-g9wp-g9m6 - CC BY 4.0
Schwachstellenhistorie: squel
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.