loopback-connector-postgresql Vulnerable to Improper Sanitization of `contains` Filter
Improper input validation on the contains LoopBack filter may allow for arbitrary SQL injection.
Impact
When the extended filter property contains is permitted to be interpreted by the Postgres connector, it is possible to inject arbitrary SQL which may affect the confidentiality and integrity of data stored on the connected database.
This affects users who does any of the following:
- Connect to the database via the DataSource with
allowExtendedProperties: truesetting OR - Uses the connector's CRUD methods directly OR
- Uses the connector's other methods to interpret the LoopBack filter.
Patches
Patch release loopback-connector-postgresql@5.5.1 has been published of which resolves this issue.
Workarounds
Users who are unable to upgrade should do the following if applicable:
- Remove
allowExtendedProperties: trueDataSource setting - Add
allowExtendedProperties: falseDataSource setting - When passing directly to the connector functions, manually sanitize the user input for the
containsLoopBack filter beforehand.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | loopback-connector-postgresql | < 5.5.1 | 5.5.1 |
References
- https://github.com/loopbackio/loopback-connector-postgresql/security/advisories/GHSA-j259-6c58-9m58
- https://nvd.nist.gov/vuln/detail/CVE-2022-35942
- https://github.com/loopbackio/loopback-connector-postgresql/commit/d57406c6737692a3a106b58a35406290cddb23e5
- https://github.com/loopbackio/loopback-connector-postgresql
- CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H- Weakness (CWE)
CWE-20, CWE-89- Platform
- npm
- Package
loopback-connector-postgresql- Disclosed
- 11.08.2022
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-j259-6c58-9m58 - CC BY 4.0
Vulnerability history: loopback-connector-postgresql
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.