Loopback Connector PostgresqlDatabase / datastore · Linuxfoundation

CVE-2022-35942

CRITICAL · 10.0 CVSS v3.1 Published 2022-08-12
Fix available
A fix is available. Upgrade to 5.5.1 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

SQL injection vulnerability in LoopBack's PostgreSQL connector allows attackers to inject arbitrary SQL through the `contains` filter when `allowExtendedProperties: true` is enabled or when connector CRUD methods interpret the LoopBack filter directly, enabling complete compromise of database confidentiality and integrity.

MitigationUpgrade to LoopBack PostgreSQL connector version 5.5.1; if upgrade is not possible, disable `allowExtendedProperties` in DataSource settings and manually sanitize any user input passed to the `contains` filter before passing to connector functions.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Loopback Connector PostgresqlDatabase / datastore
Affected:< 5.5.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify LoopBack PostgreSQL connector version
    Run 'npm list @loopback/connector-postgresql' or check package.json dependencies to find the installed version number
    Affected if Installed version is lower than 5.5.1
  2. Check DataSource configuration for allowExtendedProperties
    Inspect your DataSource configuration file (typically in datasources.json or datasources.ts) and look for the 'allowExtendedProperties' setting
    Affected if allowExtendedProperties is set to true in the DataSource configuration
  3. Verify if contains filter is used with database queries
    Search your application code for usage of the 'contains' operator in LoopBack filter objects passed to connector methods such as find(), findById(), or directly via repository methods
    Affected if The 'contains' filter operator is being used with unsanitized user input
  4. Check for direct connector method usage
    Review code that calls connector CRUD methods (like connector.find(), connector.execute()) directly with LoopBack filter objects rather than through model repository methods
    Affected if Connector methods are called directly with LoopBack filter objects containing user-supplied data

You are affected if your LoopBack PostgreSQL connector version is below 5.5.1 AND you either have allowExtendedProperties enabled OR use the contains filter with user input in direct connector method calls.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 5.5.1 or later
Fixed in 5.5.1
Vendor patch github.com →
Interim mitigation

Upgrade to LoopBack PostgreSQL connector version 5.5.1; if upgrade is not possible, disable `allowExtendedProperties` in DataSource settings and manually sanitize any user input passed to the `contains` filter before passing to connector functions.

Recommended fix High confidence

5.5.1

  1. Upgrade the loopback-connector-postgresql package to version 5.5.1 or later by running: npm install [email protected] or npm update loopback-connector-postgresql
  2. Verify the upgrade by checking the installed version with: npm list loopback-connector-postgresql
  3. If you cannot upgrade immediately, mitigate by setting `allowExtendedProperties: false` in your DataSource configuration
  4. If using the connector's CRUD methods directly with user input containing the `contains` filter, manually sanitize the input before passing it to the connector

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Loopback Connector Postgresql Scoped from the published advisory
  • Consultation4.0 h
  • Implementation6.0 h
  • Testing4.0 h
  • Review / QA3.0 h
17.0 hours of engineering $3,020
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,832.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-35942 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-35942 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data