Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-jp74-mfrx-3qvh
No affected components available
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
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. No user interaction is needed for the attacker to exploit this vulnerability. The vulnerability can affect other systems as well, not just the initial system. There is a high impact on the confidentiality of the information. There is a high impact on the integrity of the data. There is a high impact on the availability of the system.
Active exploitation in the wild has been confirmed. Immediate patching or mitigation is required.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard