CVE-2026-41478: Saltcorn SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-jp74-mfrx-3qvh
CVSS 9.9
CWE-89
Published
Advisory Summary

CVE-2026-41478 is a CRITICAL (CVSS 9.9) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Saltcorn libraries in the npm ecosystem. The issue involves sql injection via unparameterized sync endpoints (maxloadedid). Remediation is available by upgrading affected packages to version 1.4.6, 1.5.6, 1.6.0-beta.5.

CVE-2026-41478 at a Glance

CVE Identifier CVE-2026-41478
GHSA Identifier GHSA-jp74-mfrx-3qvh
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Saltcorn
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-41478

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

@saltcorn/server fixed: 1.4.6
npm install @saltcorn/server@1.4.6
@saltcorn/server fixed: 1.5.6
npm install @saltcorn/server@1.5.6
@saltcorn/server fixed: 1.6.0-beta.5
npm install @saltcorn/server@1.6.0-beta.5
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 @saltcorn/server

How to Check if You Are Affected

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

npm ls @saltcorn/server

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

Note: The npm ls @saltcorn/server 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 Saltcorn, 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

### 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_changes` - `POST /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}` - `packages/server/routes/sync.js` — `getDelRows()` - timestamp expressions built from request-controlled values and inserted into SQL - `packages/server/routes/sync.js` — `/load_changes` route 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

CVE-2026-41478 Affected Saltcorn Versions

3 component(s)
Fixed Versions:
1.4.61.5.61.6.0-beta.5
Product / Package Ecosystem Affected Versions Fixed Version
@saltcorn/server
npm
< 1.4.6
1.4.6
@saltcorn/server
npm
≥ 1.5.0-beta.0
< 1.5.6
1.5.6
@saltcorn/server
npm
≥ 1.6.0-alpha.0
< 1.6.0-beta.5
1.6.0-beta.5

References

Frequently Asked Questions

What is CVE-2026-41478?
CVE-2026-41478 is a security vulnerability in Saltcorn involving SQL Injection via Unparameterized Sync Endpoints (maxLoadedId) under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Saltcorn versions are affected?
Affected versions include releases prior to 1.4.6, 1.5.6, 1.6.0-beta.5 across affected packages: @saltcorn/server.
What version fixes CVE-2026-41478?
Upgrading to 1.4.6, 1.5.6, 1.6.0-beta.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @saltcorn/server affected?
Yes, @saltcorn/server is affected in releases prior to 1.4.6, 1.5.6, 1.6.0-beta.5. Upgrade your dependency to 1.4.6, 1.5.6, 1.6.0-beta.5 or later.
What is the CVSS score of CVE-2026-41478?
CVE-2026-41478 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-41478?
CVE-2026-41478 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-2026-41478?
Run the dependency tree command: 'npm ls @saltcorn/server'. 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-jp74-mfrx-3qvh",
  "modified" : "2026-04-27T16:20:03Z",
  "published" : "2026-04-16T22:51:43Z",
  "aliases" : [ "CVE-2026-41478" ],
  "summary" : "Saltcorn: SQL Injection via Unparameterized Sync Endpoints (maxLoadedId)",
  "details" : "### Summary\nA 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. \n\n### Details\nThe issue affects the mobile-sync endpoints:\n\n- `POST /sync/load_changes`\n- `POST /sync/deletes`\n\nAccording 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()`. \n\nRelevant vulnerable code paths include:\n\n- `packages/server/routes/sync.js` — `getSyncRows()`\n  - branch using `where data_tbl.\"${db.sqlsanitize(pkName)}\" > ${syncInfo.maxLoadedId}`\n  - branch using `and info_tbl.ref > ${syncInfo.maxLoadedId}`\n- `packages/server/routes/sync.js` — `getDelRows()`\n  - timestamp expressions built from request-controlled values and inserted into SQL\n- `packages/server/routes/sync.js` — `/load_changes` route handler\n  - request body fields are passed into the SQL-building functions without validation or safe binding\n\nThe 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. \n\nThis 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. \n\n### PoC\nBased 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. \n\n### Impact\n- **Type:** SQL injection\n- **Who is impacted:** Any Saltcorn deployment exposing the affected mobile-sync routes to authenticated users\n- **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\n- **Attack preconditions:** The attacker needs a valid authenticated account with access to at least one readable table through the sync feature\n- **Privilege impact:** The issue allows escalation from normal user access to database-wide compromise",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@saltcorn/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@saltcorn/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0-beta.0"
      }, {
        "fixed" : "1.5.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@saltcorn/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.6.0-alpha.0"
      }, {
        "fixed" : "1.6.0-beta.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/saltcorn/saltcorn/security/advisories/GHSA-jp74-mfrx-3qvh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41478"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/saltcorn/saltcorn"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T22:51:43Z",
    "nvd_published_at" : "2026-04-24T21:16:19Z"
  }
}