{"id":"GHSA-j259-6c58-9m58","summary":"loopback-connector-postgresql Vulnerable to Improper Sanitization of `contains` Filter","details":"Improper input validation on the `contains` LoopBack filter may allow for arbitrary SQL injection.\n\n### Impact\n\nWhen 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.\n\nThis affects users who does any of the following:\n\n- Connect to the database via the DataSource with `allowExtendedProperties: true` setting OR\n- Uses the connector's CRUD methods directly OR\n- Uses the connector's other methods to interpret the LoopBack filter.\n\n### Patches\n\nPatch release `loopback-connector-postgresql@5.5.1` has been published of which resolves this issue.\n\n### Workarounds\n\nUsers who are unable to upgrade should do the following if applicable:\n\n- Remove `allowExtendedProperties: true` DataSource setting\n- Add `allowExtendedProperties: false` DataSource setting\n- When passing directly to the connector functions, manually sanitize the user input for the `contains` LoopBack filter beforehand.\n\n","aliases":["CVE-2022-35942"],"modified":"2023-11-08T04:09:53.649923Z","published":"2022-08-11T21:13:43Z","database_specific":{"github_reviewed":true,"cwe_ids":["CWE-20","CWE-89"],"severity":"CRITICAL","nvd_published_at":"2022-08-12T23:15:00Z","github_reviewed_at":"2022-08-11T21:13:43Z"},"references":[{"type":"WEB","url":"https://github.com/loopbackio/loopback-connector-postgresql/security/advisories/GHSA-j259-6c58-9m58"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35942"},{"type":"WEB","url":"https://github.com/loopbackio/loopback-connector-postgresql/commit/d57406c6737692a3a106b58a35406290cddb23e5"},{"type":"WEB","url":"https://github.com/loopbackio/loopback-connector-postgresql"}],"affected":[{"package":{"name":"loopback-connector-postgresql","ecosystem":"npm","purl":"pkg:npm/loopback-connector-postgresql"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.5.1"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/08/GHSA-j259-6c58-9m58/GHSA-j259-6c58-9m58.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"}]}