/

CVE-2026-41478

Severity:

CRITICAL RISK

(9.9)

SQL Injection in Saltcorn Mobile-Sync Routes

CVE-2026-41478

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution and Data Exfiltration

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection flaw in Saltcorn's mobile-sync routes allows authenticated low-privilege users to inject arbitrary SQL through sync parameters when they have read access to at least one table.

Under these conditions, an attacker can exfiltrate sensitive data such as admin password hashes and configuration secrets, and may be able to modify or destroy database contents depending on the backend.

Affected context

This vulnerability appears in Saltcorn deployments that expose the mobile-sync functionality and allow authenticated users, including low-privilege accounts, to synchronize data from at least one table.

The issue manifests where sync parameters are incorporated into backend SQL queries without sufficient validation, sanitization, or safe query construction, particularly in environments where the database user has broad privileges over application data.

Exploit preconditions

  • Attack surface: Saltcorn mobile-sync HTTP routes accessible to authenticated users.
  • Required access: Any authenticated user account with read access to at least one table that can be synced via the mobile-sync feature.
  • Trigger point: Supplying crafted sync parameters (e.g., filters, offsets, identifiers) that are embedded into SQL statements by the server-side sync logic.
  • Why exploitation is possible: The sync parameters are dynamically interpolated into SQL queries or query fragments without robust input handling or use of fully parameterized statements, allowing attacker-controlled values to alter the structure of the executed SQL.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Within the mobile-sync routes, user-provided parameters are used to construct SQL queries in a way that treats portions of the input as part of the query syntax rather than as data.

This typically occurs when concatenating strings, embedding unescaped input into WHERE clauses or ORDER BY segments, or using dynamic query builders without proper parameterization and whitelisting of allowed fields and operations.

Because the database executes the resulting SQL verbatim, an attacker can craft inputs that introduce additional statements, modify clauses, or bypass logical constraints, leading to arbitrary query execution in the context of the application's database account.

Potential impact

  • Exfiltration of entire database contents, including user records, application data, and configuration tables.
  • Access to admin password hashes and other authentication-related data, which could aid in offline cracking or account takeover if reused.
  • Exposure of configuration secrets stored in the database, such as API keys, integration tokens, or encryption-related metadata.
  • Unauthorized modification of data, including tampering with records, inserting malicious entries, or altering application configuration stored in the database.
  • Deletion or destruction of data, including dropping tables or truncating critical datasets, depending on database permissions.
  • Potential pivoting into other application components that rely on the compromised data or configuration.

General mitigation guidance

Reducing the risk of SQL injection in similar contexts typically involves a combination of safe query construction, strict input handling, and privilege minimization.

Pattern-based mitigations include:

  • Using parameterized queries or prepared statements for all user-influenced SQL, ensuring that parameters are always treated as data rather than query syntax.
  • Implementing strict whitelisting for dynamic aspects of queries (e.g., which columns can be filtered or sorted) instead of allowing arbitrary field names or fragments from the client.
  • Normalizing and validating sync parameters against expected types, ranges, and formats, rejecting or defaulting unexpected values before they reach the query layer.
  • Refactoring query-building logic to avoid string concatenation for WHERE, ORDER BY, and LIMIT/OFFSET segments, favoring high-level query builders that enforce separation of code and data.
  • Applying least-privilege principles to the database account used by the application, limiting its ability to perform schema changes or access non-essential tables.
  • Segregating especially sensitive data (such as secrets or admin credentials) into more restricted schemas or storage mechanisms, so that compromise of general application queries yields less critical information.

How teams detect issues like this

Detecting SQL injection issues in mobile-sync or similar API routes is often achieved through a combination of code-centric and operational approaches.

Common strategies include:

  • Static code analysis rules that flag dynamic SQL construction, string concatenation with user-controlled values, or unsafe use of query APIs in request handlers.
  • Code review checklists that explicitly require reviewers to verify parameterized queries for all endpoints handling filters, sorting, or synchronization parameters.
  • Instrumentation or logging that captures anomalous query patterns, such as unexpected use of SQL keywords, unusually complex conditions, or queries referencing unrelated tables, for security monitoring.
  • Integration of security linters or application security testing tools into CI pipelines to scan for known query-building anti-patterns and unsafe patterns around mobile or sync routes.
  • Runtime application security monitoring or database-level auditing, focusing on detecting suspicious queries executed under the application's database user, especially ones that access configuration tables or admin-related records.

Sources

SourceLink
github.comgithub.com/saltcorn/saltcorn/security/advisories/GHSA-jp74-mfrx-3qvh

Frequently asked

questions

Within the privileges of the application's database account, an attacker can potentially read arbitrary tables, including those storing admin password hashes and configuration secrets, and may be able to modify or delete data if the account has such permissions.

No. The vulnerability can be exploited by any authenticated user who has read access to at least one table exposed through mobile-sync, even if their role is considered low-privilege.

The safest approach is to ensure all user-controlled input used in SQL is passed through parameterized queries or prepared statements, combined with strict whitelisting of allowable query parameters (such as fields, operators, and sort keys), and avoiding raw string concatenation for query construction.

Prevention typically involves establishing secure coding guidelines for data access, mandating parameterized queries, adopting query builder libraries that minimize direct SQL string manipulation, enforcing input validation at API boundaries, and incorporating automated checks for SQL injection patterns in development and code review workflows.

Find out what's already
exploitable in your codebase.