/

CVE-2026-50636

Severity:

HIGH RISK

(8.8)

SQL Injection (CWE-89) in LimeSurvey RemoteControl API

CVE-2026-50636

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution with data exfiltration and modification

Severity:

HIGH RISK

(8.8)

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 LimeSurvey's RemoteControl API allows attacker-controlled token IDs to be concatenated directly into an SQL IN clause without parameterization.

When the RemoteControl interface is enabled and an authenticated user has tokens/update permission on a survey, they can inject stacked SQL queries to read or modify arbitrary database data, potentially taking over administrator accounts and destroying survey data.

Affected context

The vulnerability arises within LimeSurvey's RemoteControl API, specifically when invite_participants and remind_participants call TokenDynamic::findUninvited() using a caller-supplied array of token IDs.

It is relevant when:

  • The RemoteControl interface (RPCInterface = json/xml) is enabled.
  • The application uses a PDO MySQL connection with emulatePrepare set to true and multi-statements not disabled.
  • Authenticated users can reach the affected methods for surveys where they hold tokens/update permission.

Under these conditions, token identifiers provided by the API caller are treated as trusted input and embedded directly into SQL, creating an injection sink.

Exploit preconditions

  • Attack surface: LimeSurvey RemoteControl API endpoints (invite_participants, remind_participants).
  • Required access: Valid authentication plus tokens/update permission on at least one survey; RemoteControl must be enabled in configuration.
  • Trigger point: Invocation of RemoteControl API methods that pass a caller-controlled token-ID array into TokenDynamic::findUninvited(), which builds a tid IN ('...') SQL clause.
  • Why exploitation is possible: The token-ID array elements are concatenated into the SQL string without parameterization or validation.

With PDO emulatePrepare enabled and MySQL multi-statements allowed, injected payloads can terminate the original query and append additional SQL statements (stacked queries).

Why this happens

This issue stems from constructing SQL queries by directly concatenating untrusted input into a WHERE clause, rather than using bound parameters.

In TokenDynamic::findUninvited(), the token ID values from the API caller are interpolated into a tid IN ('value1','value2',...) expression with no type enforcement, quoting discipline, or input sanitization.

Because PDO is configured with emulated prepared statements, the database driver does not provide true server-side parameterization, and MySQL multi-statements remain available.

This combination maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where user-controlled data is allowed to alter the structure of the SQL statement itself, enabling execution of arbitrary queries.

Potential impact

  • Read access to sensitive tables, including administrator bcrypt password hashes (e.g., lime_users), survey responses containing PII, session data, and configuration tables.
  • Time-based blind exfiltration of arbitrary data via SLEEP()-driven or similar timing oracles even when error messages are not exposed.
  • Overwriting of administrator password hashes or other authentication data, enabling immediate administrator account takeover.
  • Arbitrary modification or destruction of data via injected INSERT, UPDATE, DELETE, TRUNCATE, or DROP statements.
  • Creation or alteration of tables or schemas (CREATE/ALTER) accessible to the LimeSurvey database user, potentially facilitating persistence or further exploitation.
  • Cross-tenant data exposure in shared databases where the application's DB user has privileges on multiple schemas.

General mitigation guidance

Effective mitigation focuses on enforcing strict separation between data and SQL logic and tightening database capabilities exposed to the application:

  • Use parameterized queries or query builders that reliably bind all dynamic values, including elements of IN clauses, rather than manually concatenating arrays into SQL strings.
  • Normalize and constrain token identifiers to a well-defined primitive type (for example, integers or fixed-format strings), rejecting any values that do not match the expected format before they reach the data-access layer.
  • Avoid string-based construction of IN ('...') lists; instead, generate placeholders for each element and bind them explicitly or use framework helpers that handle this pattern safely.
  • Configure database clients to rely on true server-side prepared statements and, where feasible, disable multi-statement execution to reduce the impact of any remaining injection defects.
  • Apply least-privilege principles to the application's database user, limiting its ability to perform destructive operations (such as DROP or CREATE) and restricting access to only those schemas and tables required for normal operation.
  • Treat RemoteControl and similar remote management interfaces as high-risk surfaces: expose them only where necessary, enforce strict authentication and authorization, and favor deny-by-default permissions for sensitive operations like bulk token management.

How teams detect issues like this

Detection generally combines code-centric and behavior-centric approaches:

  • Static analysis: Configure SAST tools to flag any SQL construction that directly interpolates request parameters or arrays (such as token lists) into query strings, especially around IN clauses or dynamic WHERE fragments.
  • Code review: During manual review, look for data-access routines that accept raw arrays of identifiers, as well as uses of string concatenation or implode to build SQL, and verify that PDO or framework layers are using server-side prepared statements with bound parameters.
  • Policy enforcement: Introduce secure coding guidelines and pre-commit hooks that prohibit non-parameterized SQL in the codebase, and enforce them through CI checks on merge requests.
  • Runtime monitoring: Use database and application logging to identify anomalous patterns such as unexpected multi-statement queries, use of functions like SLEEP() or BENCHMARK() in application-generated SQL, and sudden bursts of highly complex queries targeting administrative tables.
  • Configuration auditing: Periodically audit the database and PDO or driver configuration for unsafe defaults like emulatePrepare = true with multi-statements enabled, and track deviations from hardening baselines.

Sources

SourceLink
github.comgithub.com/LimeSurvey/LimeSurvey/pull/5031
limesurvey.orglimesurvey.org/
vulncheck.comvulncheck.com/advisories/limesurvey-remotecontrol-invite-participants-remind-participants-sql-injection

Frequently asked

questions

Exploitation requires that the RemoteControl interface be enabled and that the attacker holds valid credentials with tokens/update permission on at least one survey.

In environments where RemoteControl is disabled or such permissions are tightly restricted, the exposure surface is smaller, but where these conditions are met the attacker can generally execute powerful SQL queries.

No.

The attacker only needs an account with RemoteControl access and the ability to invoke invite_participants or remind_participants for a survey they control.

From there, the injection can target administrator data and other global tables in the database.

The most robust fix is to replace any string-concatenated SQL with parameterized queries that bind each dynamic value, including elements in IN lists, and to validate token IDs against a strict, simple schema before they reach the database layer.

Combining strong input validation with true prepared statements and reduced database privileges significantly limits the damage of any remaining defects.

Treat all external input as untrusted, mandate the use of parameterized queries or ORM abstractions, and build automated checks that block non-parameterized SQL from being merged.

Additionally, regularly review high-privilege interfaces like remote APIs, harden database configurations (disabling multi-statements where possible), and conduct routine security testing focused on query-building code paths.

Find out what's already
exploitable in your codebase.