Summary
A SQL injection flaw in LimeSurvey allows crafted input to be interpreted as part of database queries, rather than as data.
Under certain conditions, a remote attacker can abuse this behavior to extract sensitive information from the LimeSurvey database, such as user data or survey contents.
Affected context
This vulnerability affects LimeSurvey installations running versions prior to 6.15.4+250710 where user-supplied data is interpolated into SQL queries without sufficient sanitization or parameterization.
The issue typically arises in HTTP-exposed application endpoints that accept request parameters and interact with the database layer.
It becomes relevant when LimeSurvey is deployed with network reachability from untrusted clients (e.g., internet-facing survey portals) and when the underlying database contains sensitive or regulated information.
Exploit preconditions
- Attack surface: Web-facing LimeSurvey endpoints that consume user-supplied parameters and perform database operations.
- Required access: Remote, unauthenticated or low-privileged access to affected functionality, depending on the specific vulnerable route.
- Trigger point: Submission of specially crafted input fields (e.g., query parameters, form fields, or survey inputs) that are concatenated into SQL queries.
- Why exploitation is possible: The application constructs SQL statements by directly embedding untrusted input, allowing attackers to alter the structure of the query instead of treating input as data only.
Why this happens
The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
At a design level, dynamic SQL statements are built by concatenating or interpolating raw user input into query strings, without enforcing strict parameterization or adequate escaping.
This insecure pattern treats incoming data as trusted and fails to establish a clear boundary between query logic and external data, enabling attackers to introduce additional predicates, UNION clauses, or other SQL syntax.
Potential impact
- An attacker may retrieve sensitive records from LimeSurvey's database (e.g., survey responses, user accounts, contact lists).
- An attacker could enumerate database schema details such as table names, column names, and metadata.
- An attacker may bypass some logical restrictions by manipulating WHERE clauses or filters.
- In certain environments, SQL-level abuse could facilitate further compromise, such as pivoting to other data sources connected to the same database.
General mitigation guidance
SQL injection defenses generally focus on enforcing strict separation between SQL code and user data:
- Prefer parameterized queries / prepared statements in all database access layers, avoiding string concatenation for query construction.
- Centralize query building through well-reviewed data access abstractions or ORM APIs that default to safe parameterization.
- Apply robust server-side validation and normalization of all externally supplied input, enforcing strict typing and whitelisting where feasible.
- Limit database privileges for the LimeSurvey application account to the minimum required (least privilege), reducing the blast radius of a successful injection.
- Consider introducing query-building patterns or frameworks that discourage raw SQL usage except in tightly controlled cases.
How teams detect issues like this
Detection typically combines preventive and detective controls:
- Use static application security testing (SAST) to flag dynamic SQL construction patterns where user input reaches query strings without parameter binding.
- During code review, search for direct string concatenation in SQL statements, ad-hoc query builders, and any bypasses around existing data access APIs.
- Apply security-focused unit and integration tests that attempt invalid and boundary inputs, looking for anomalous database errors or unexpected result sets.
- Monitor application and database logs for suspicious query patterns (e.g., unexpected UNION, OR 1=1 conditions, or syntax errors originating from user-controllable fields).

