/

CVE-2026-45545

Severity:

HIGH RISK

(8.2)

SQL Injection in Nextcloud Tables App

CVE-2026-45545

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exfiltration and Integrity Compromise via SQL Injection

Severity:

HIGH RISK

(8.2)

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 vulnerability in the Nextcloud Tables app allows an authenticated user to inject arbitrary SQL fragments into database queries via stored data.

Although queries are nominally limited to 20 bytes, crafted input can bypass this restriction, enabling data extraction or modification in the underlying database.

Affected context

This issue arises in deployments of the Nextcloud Tables app where user-controlled content is persisted and later incorporated into SQL queries without robust parameterization.

The vulnerability affects authenticated users who have access to the Tables app and can store data that will be used in backend query construction.

The risk is most relevant in environments where the Tables app is used to manage or visualize sensitive data backed by the same database as other Nextcloud components.

Exploit preconditions

  • Attack surface: Web interface of the Nextcloud Tables app.
  • Required access: Valid authenticated Nextcloud account with permission to access and use the Tables app.
  • Trigger point: Rendering, processing, or querying of stored table entries that are concatenated or interpolated into SQL statements.
  • Why exploitation is possible: The application takes user-supplied data from stored records and incorporates it into SQL queries without consistently using parameterized queries or proper escaping, allowing crafted input to alter the structure of the SQL statement. A nominal 20-byte length restriction exists but can be bypassed by carefully constructed payloads.

Why this happens

The core issue maps to CWE-89: SQL Injection, where untrusted input influences the structure of SQL commands.

In the affected versions of the Nextcloud Tables app, some query-building paths rely on string concatenation or otherwise fail to strictly separate query logic from user-controlled values.

Because user data is stored and later reused in query construction, an attacker can persist malicious fragments that, when executed, modify the intended query semantics—such as changing WHERE clauses, adding UNION operations, or introducing additional statements—despite an attempted length cap.

This pattern reflects a general failure to enforce strict parameterization and input handling for all database interactions.

Potential impact

  • Attackers may extract sensitive data from tables accessible through the compromised queries.
  • Attackers could read data from other tables in the same database, depending on schema and query context.
  • Stored records may be modified, corrupted, or deleted, impacting data integrity.
  • Application behavior and business logic that relies on table contents can be altered or disrupted.
  • Under certain database configurations, attackers might escalate to broader database compromise if they can chain queries or abuse extended SQL primitives.

General mitigation guidance

Effective mitigation focuses on consistently separating SQL logic from data and tightening trust boundaries around stored content:

  • Adopt parameterized queries or prepared statements for all database operations, ensuring that user-controlled values cannot alter query structure.
  • Centralize query construction in a limited set of data access layers or repositories where secure patterns can be enforced and reviewed.
  • Avoid dynamic SQL built from concatenated strings; instead use query builders or ORM abstractions that model queries declaratively.
  • Apply strict validation and normalization on inputs stored by the Tables app, limiting allowed characters and patterns to what the business logic truly requires.
  • Minimize the database privileges granted to the application account, restricting it to the smallest set of operations necessary (e.g., no superuser roles, limited schema access).
  • Consider logical separation of particularly sensitive datasets into different schemas or database instances to reduce the blast radius of any injection flaw.

How teams detect issues like this

Organizations can improve detection of similar issues using a combination of code-centric and operational approaches:

  • Static analysis: Configure rules to flag usages of string concatenation or interpolation in SQL query construction, especially within the Tables app code paths.
  • Code review practices: Treat any direct SQL construction as a security-critical section; reviewers should verify parameterization and reject ad hoc query strings.
  • Security linters and SAST tools: Integrate automated tools into CI pipelines to identify unparameterized queries and highlight high-risk API usage.
  • Runtime monitoring: Enable database logging for anomalous or unexpected query patterns, such as queries containing suspicious literals or repeated probing of metadata tables.
  • Policy enforcement: Establish organizational guidelines that require ORMs or vetted query-builder utilities and prohibit raw dynamic SQL except under strictly reviewed circumstances.

Sources

SourceLink
github.comgithub.com/nextcloud/security-advisories/security/advisories/GHSA-x43f-gmgh-vvjj
github.comgithub.com/nextcloud/tables/pull/2309
hackerone.comhackerone.com/reports/3462991

Frequently asked

questions

Yes, if the Nextcloud instance is accessible over the internet and an attacker can register or obtain an account with access to the Tables app. The attack itself is performed via normal web requests to the application.

No. The attacker needs an authenticated account with permission to use the Tables app, but does not require administrative privileges. The exact impact may increase if the application's database role has broad privileges.

The most robust fix is to ensure that all database queries are constructed using parameterized statements or a trusted ORM/query-builder layer, eliminating any concatenation of user-controlled data into SQL strings. Additionally, validate and constrain user inputs to expected formats before storage.

Establish development standards that forbid dynamic SQL string building with user input, mandate the use of parameterized queries, and require security-focused code review for all data access code. Complement this with static analysis rules and CI checks that automatically flag insecure query construction patterns before code is merged.

Find out what's already
exploitable in your codebase.