Summary
EUSurvey's public results page has an SQL injection flaw in how it builds queries from a user-supplied filter parameter. An unauthenticated visitor may exploit the behavior on a survey that publishes results to infer non-public response data and respondent metadata.
Affected context
The issue affects EUSurvey versions 1.4.4.6738 through 1.6 before commit de1145c. It occurs in the public GET /publication/{shortname} results page, where ReportingService uses part of a filter parameter name to form a SQL column expression. The risk arises when a survey publishes results and the resulting rows can reveal whether injected boolean conditions match private reporting data, including data from other surveys.
Exploit preconditions
- Attack surface: The public results page at
GET /publication/{shortname} - Required access: No authentication is required to access the page
- Trigger point: Processing of a visitor-supplied filter parameter
- Relevant condition: The target survey must publish results through the page
- Why exploitation is possible: User-controlled parameter-name content influences a SQL expression, and observable result-row presence or absence can reveal information about query outcomes
Why this happens
ReportingService constructs part of a SQL column expression from a user-controlled filter parameter name and inserts it into a query. Treating that input as SQL structure rather than safely constrained data creates an injection point. This is CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Potential impact
- An unauthenticated visitor may infer non-public survey response data
- Respondent metadata may be exposed through repeated query observations
- Data from other surveys may be inferred if it is reachable through the affected reporting query
General mitigation guidance
Mitigation generally focuses on preventing user input from changing SQL query structure and limiting the sensitivity of data exposed by public reporting.
Common defensive patterns include:
- Use parameterized queries for values and avoid constructing SQL identifiers from request input
- Map accepted filter names to a fixed, allowlisted set of database columns
- Validate request parameters against a strict schema before query construction
- Limit public reports to explicitly approved fields and aggregate results where appropriate
- Apply least-privilege database access so reporting queries cannot access unrelated sensitive data
How teams detect issues like this
High-level approaches to finding similar issues include:
- Static analysis for request-derived values concatenated into SQL statements or identifiers
- Code review of query builders, especially dynamic column selection and filter handling
- Tests that verify unsupported filter names are rejected and cannot alter query structure
- Policy checks requiring parameterized queries and allowlists for dynamic identifiers
- Monitoring for unusual or repeated filter requests and unexpected result-row patterns

