CVE-2025-32020: Crud query parser SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-9r25-rp3p-h2w4
CWE-89
Published
Advisory Summary

CVE-2025-32020 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Crud query parser libraries in the npm ecosystem. The issue involves crud-query-parser sql injection vulnerability. Remediation is available by upgrading affected packages to version 0.1.0.

CVE-2025-32020 at a Glance

CVE Identifier CVE-2025-32020
GHSA Identifier GHSA-9r25-rp3p-h2w4
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Crud query parser
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-32020

To remediate this vulnerability, upgrade all affected Crud query parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

crud-query-parser fixed: 0.1.0
npm install crud-query-parser@0.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls crud-query-parser

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-32020, inspect your project dependencies using npm:

npm ls crud-query-parser

Analyze the terminal output to locate any version of Crud query parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.0), your application is affected.

Note: The npm ls crud-query-parser command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Crud query parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Improper neutralization of the `order`/`sort` parameter in the TypeORM adapter, which allows SQL injection. You are impacted by this vulnerability if you are using the TypeORM adapter, ordering is enabled and you have not set-up a property filter. Versions 0.0.1, 0.0.2 and 0.0.3 are affected by this vulnerability. ### Patches This vulnerability has been fixed in version 0.1.0 and newer, which introduces TypeORM field validation (enabled by default). ### Workarounds #### Add an allowlist of fields List all valid fields and use the `filterProperties` function to filter out invalid fields before passing the crudRequest to the `TypeOrmQueryAdapter`. Here's an example: ```ts crudRequest = filterProperties(crudRequest, ['id', 'title', 'category.name']); ``` #### Disable ordering Cleanup the `order` field just before passing it to the `TypeOrmQueryAdapter`. Here's an example: ```ts crudRequest.order = []; ```

CVE-2025-32020 Affected Crud query parser Versions

1 component(s)
Fixed Versions:
0.1.0
Product / Package Ecosystem Affected Versions Fixed Version
crud-query-parser
npm
< 0.1.0
0.1.0

References

Frequently Asked Questions

What is CVE-2025-32020?
CVE-2025-32020 is a security vulnerability in Crud query parser involving crud-query-parser SQL Injection vulnerability under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Crud query parser versions are affected?
Affected versions include releases prior to 0.1.0 across affected packages: crud-query-parser.
What version fixes CVE-2025-32020?
Upgrading to 0.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is crud-query-parser affected?
Yes, crud-query-parser is affected in releases prior to 0.1.0. Upgrade your dependency to 0.1.0 or later.
What CWE is associated with CVE-2025-32020?
CVE-2025-32020 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check npm dependencies for CVE-2025-32020?
Run the dependency tree command: 'npm ls crud-query-parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9r25-rp3p-h2w4",
  "modified" : "2025-04-09T12:57:13Z",
  "published" : "2025-04-09T12:57:13Z",
  "aliases" : [ "CVE-2025-32020" ],
  "summary" : "crud-query-parser SQL Injection vulnerability",
  "details" : "### Impact\n\nImproper neutralization of the `order`/`sort` parameter in the TypeORM adapter, which allows SQL injection.\n\nYou are impacted by this vulnerability if you are using the TypeORM adapter, ordering is enabled and you have not set-up a property filter.\n\nVersions 0.0.1, 0.0.2 and 0.0.3 are affected by this vulnerability.\n\n### Patches\n\nThis vulnerability has been fixed in version 0.1.0 and newer, which introduces TypeORM field validation (enabled by default).\n\n### Workarounds\n\n#### Add an allowlist of fields\nList all valid fields and use the `filterProperties` function to filter out invalid fields before passing the crudRequest to the `TypeOrmQueryAdapter`. Here's an example:\n```ts\ncrudRequest = filterProperties(crudRequest, ['id', 'title', 'category.name']);\n```\n\n#### Disable ordering\nCleanup the `order` field just before passing it to the `TypeOrmQueryAdapter`. Here's an example:\n```ts\ncrudRequest.order = [];\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "crud-query-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Guichaguri/crud-query-parser/security/advisories/GHSA-9r25-rp3p-h2w4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-32020"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Guichaguri/crud-query-parser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-09T12:57:13Z",
    "nvd_published_at" : "2025-04-08T15:15:50Z"
  }
}