Advisory

GHSA-9r25-rp3p-h2w4

Also known as: CVE-2025-32020

Summary

crud-query-parser SQL Injection vulnerability

Details

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:

crudRequest = filterProperties(crudRequest, ['id', 'title', 'category.name']);

Disable ordering
Cleanup the order field just before passing it to the TypeOrmQueryAdapter. Here's an example:

crudRequest.order = [];

Severity

High Basis: The source's own band: HIGH

Dates

Published
2025-04-09 12:57 UTC
Modified
2025-04-09 13:42 UTC

Affected packages and fixes

crud-query-parser

npm · All systems

Affected

  • introduced 0, fixed 0.1.0 (semver)

Fixed versions

0.1.0

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences