GHSA-jp74-mfrx-3qvh
CRITICALGHSA-jp74-mfrx-3qvh is a critical-severity (CVSS 9.9) vulnerability in @saltcorn/server. O3 Security confirms whether GHSA-jp74-mfrx-3qvh is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Saltcorn: SQL Injection via Unparameterized Sync Endpoints (maxLoadedId)
Real-World Exposure
@saltcorn/server📦@saltcorn/server📦@saltcorn/serverReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
Summary
A critical SQL injection vulnerability in Saltcorn’s mobile-sync routes allows any authenticated low-privilege user with read access to at least one table to inject arbitrary SQL through sync parameters. This can lead to full database exfiltration, including admin password hashes and configuration secrets, and may also enable database modification or destruction depending on the backend.
Details
The issue affects the mobile-sync endpoints:
POST /sync/load_changesPOST /sync/deletes
According to the provided analysis, user-controlled values from the request body are interpolated directly into SQL template literals without parameterization, type enforcement, or sanitization. In particular, req.body.syncInfos[tableName].maxLoadedId is embedded into SQL in getSyncRows() and timestamp-derived values are similarly interpolated in getDelRows().
Relevant vulnerable code paths include:
packages/server/routes/sync.js—getSyncRows()- branch using
where data_tbl."${db.sqlsanitize(pkName)}" > ${syncInfo.maxLoadedId} - branch using
and info_tbl.ref > ${syncInfo.maxLoadedId}
- branch using
packages/server/routes/sync.js—getDelRows()- timestamp expressions built from request-controlled values and inserted into SQL
packages/server/routes/sync.js—/load_changesroute handler- request body fields are passed into the SQL-building functions without validation or safe binding
The root cause is that values are treated as trusted SQL fragments rather than bound parameters. While db.sqlsanitize() is used for identifiers elsewhere, that does not protect interpolated values and is not intended to prevent value-based SQL injection. The report notes there is no parseInt(), numeric validation, or prepared-statement binding before these values are concatenated into the query string.
This means a normal authenticated user can escape the intended query logic and execute arbitrary SQL in the context of the application database. The provided evidence demonstrates successful extraction of user records and schema information through the vulnerable sync route, confirming that the injection is practically exploitable.
PoC
Based on the provided report, the issue can be reproduced by authenticating as a normal user, sending a crafted request to the affected sync endpoint, and placing a malicious SQL expression into the sync metadata field that is later interpolated into the backend query. Successful exploitation returns attacker-selected database contents in the sync response.
Impact
- Type: SQL injection
- Who is impacted: Any Saltcorn deployment exposing the affected mobile-sync routes to authenticated users
- Security impact: An authenticated low-privilege user may exfiltrate the full database, including password hashes, configuration secrets, application data, and schema information; on some backends, the same flaw may also permit writes, schema changes, or destructive operations
- Attack preconditions: The attacker needs a valid authenticated account with access to at least one readable table through the sync feature
- Privilege impact: The issue allows escalation from normal user access to database-wide compromise
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @saltcorn/server | all versions | 1.4.6 |
| 📦npm | @saltcorn/server | ≥ 1.5.0-beta.0&&< 1.5.6 | 1.5.6 |
| 📦npm | @saltcorn/server | ≥ 1.6.0-alpha.0&&< 1.6.0-beta.5 | 1.6.0-beta.5 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @saltcorn/server. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @saltcorn/server to 1.4.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-jp74-mfrx-3qvh is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-jp74-mfrx-3qvh is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-jp74-mfrx-3qvh. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-jp74-mfrx-3qvh in your dependencies?
O3 detects GHSA-jp74-mfrx-3qvh across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.