Summary
SurveyKing's result lookup can expose survey responses because the anonymous survey view reveals lookup configuration, including its password, and a password check may be skipped when no answer is provided. An unauthenticated person with a public survey link may be able to match responses and retrieve complete answers, including hidden fields.
Affected context
The issue occurs in SurveyKing's result lookup flow when a survey is publicly accessible. The anonymous view exposes lookup configuration, and the lookup path may proceed without enforcing the password check if no answer is sent. A MyBatis LIKE condition that accepts a wildcard may then match responses, which can be retrieved through loadProject using an answerId.
Exploit preconditions
- Attack surface: Public survey view and result lookup functionality
- Required access: No authentication is described as necessary; an attacker needs a public survey link
- Trigger point: Lookup processing when no answer is supplied, followed by response retrieval
- Why exploitation is possible: The password check may be skipped, and a wildcard in the
LIKEcondition may match multiple responses
Why this happens
The root cause is missing authorization enforcement in the result lookup flow, mapping to CWE-862: Missing Authorization. The application exposes lookup configuration and permits response retrieval without consistently verifying that the requester is authorized. Accepting wildcard input in a database matching condition can broaden the results returned, compounding the authorization failure.
Potential impact
- An unauthenticated requester may be able to read survey responses
- Responses may include fields that are intended to be hidden
- Exposure of respondent data could create privacy or confidentiality harms
General mitigation guidance
Defensive patterns focus on enforcing authorization at every response retrieval boundary, regardless of whether optional answer data is provided.
Common controls include:
- Requiring a validated authorization secret or equivalent check before returning any response
- Applying authorization checks server-side for each requested answer or project
- Avoiding exposure of passwords and other sensitive lookup configuration in anonymous views
- Treating user-controlled search input as data, and constraining wildcard behavior in database queries
- Returning only fields the requester is explicitly authorized to see
- Limiting application and database privileges to what the lookup feature requires
How teams detect issues like this
Review lookup and response-loading code for authorization checks that depend on optional request fields or occur only in the user interface.
Useful approaches include:
- Static analysis and code review for response access paths lacking server-side authorization
- Tests covering anonymous requests, omitted answers, invalid credentials, and attempts to retrieve hidden fields
- Review of MyBatis query construction for user-controlled
LIKEpatterns and overly broad result sets - Policy checks that prevent sensitive configuration from being serialized into public responses
- Monitoring for unusual anonymous lookup volume or repeated response retrieval requests

