{"answers":{"affected":"2 open source packages ship an affected version, including loopback-connector-postgresql. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-35942 in the wild and no public exploit code.","fix":"Upgrade loopback-connector-postgresql to 5.5.1 or later.","what":"CVE-2022-35942 is a critical SQL injection vulnerability in loopbackio loopback-connector-postgresql, published on 12 Aug 2022. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-35942 and fix it if it is affected.\n\nWhat it is: CVE-2022-35942 is a critical SQL injection vulnerability in loopbackio loopback-connector-postgresql, published on 12 Aug 2022. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-35942 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- loopback-connector-postgresql (npm): affected all versions; fixed in 5.5.1\n- loopback-connector-postgresql (npm): affected all versions; fixed in 5.5.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-35942/ (Markdown: https://insights.sbomify.com/CVE-2022-35942/index.md)","id":"CVE-2022-35942","markdown":"https://insights.sbomify.com/CVE-2022-35942/index.md","name":"CVE-2022-35942","record":{"aliases":["GHSA-j259-6c58-9m58"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"PostgreSQL connector library","requires_auth":"none","summary":"Attackers can inject arbitrary SQL via the contains filter in loopback-connector-postgresql, compromising database confidentiality and integrity.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"loopback-connector-postgresql","vendor":"linuxfoundation"}],"cvss":{"score":9.3,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"loopback-connector-postgresql Vulnerable to Improper Sanitization of `contains` Filter","id":"CVE-2022-35942","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"sql_injection","year":"2022"},"n_packages":2,"n_references":2,"next":{"headline":"SameSite may allow cross-site request forgery (CSRF) protection to be bypassed","id":"CVE-2022-35943"},"packages":[{"ecosystem":"npm","fixed":["5.5.1"],"introduced":["0"],"last_affected":[],"package":"loopback-connector-postgresql","purl":null,"source":"GHSA-j259-6c58-9m58"},{"ecosystem":"npm","fixed":["5.5.1"],"introduced":["0"],"last_affected":[],"package":"loopback-connector-postgresql","purl":"pkg:npm/loopback-connector-postgresql","source":"GHSA-j259-6c58-9m58"}],"prev":{"headline":"`CHECK` failure in `AvgPoolOp` in Tensorflow","id":"CVE-2022-35941"},"products":["loopback-connector-postgresql"],"published":"2022-08-12","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["loopbackio"]},"summary":"Attackers can inject arbitrary SQL via the contains filter in loopback-connector-postgresql, compromising database confidentiality and integrity.","url":"https://insights.sbomify.com/CVE-2022-35942/"}