LimeSurvey Community Edition 7.0.5 - Authenticated SQL injection in CPDB

6

Medium

Detected by

Fluid Attacks AI SAST Scanner

Disclosed by

Miguel Gómez

Summary

Full name

LimeSurvey Community Edition 7.0.5 - Authenticated SQL injection in CPDB token-to-participant attribute mapping

Code name

State

Public

Release date

Affected product

LimeSurvery

Vendor

LimeSurvery

Affected version(s)

7.0.5

Fixed version(s)

7.0.10

Vulnerability name

SQL injection

Vulnerability type

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

CVSS v4.0 base score

6.0

Exploit available

Yes

Description

LimeSurvey Community Edition 7.0.5 contains an authenticated SQL injection vulnerability in the Central Participant Database (CPDB) workflow that copies survey participant tokens to the central participant list.

An authenticated low-privileged user with access to the participant panel can submit a crafted token-to-CPDB attribute mapping. The mapping value is used as a raw SQL SELECT expression against the survey token table. The SQL expression result is then persisted into lime_participant_attribute.value and can be retrieved through the normal participant JSON endpoint when the target CPDB attribute is visible.

The validated impact is sensitive data extraction from the application database, including administrator usernames and password hashes. The same code path also contains an unsafe update condition for lime_participant_attribute, but no arbitrary-table write or privilege escalation primitive was confirmed.

Vulnerability

Root cause

  1. Controller-level permission is broader than the affected operation requires (ParticipantsAction.php:54-65):

    
    
    
    
    
    
    
    

    A user with participantpanel:read can reach participant actions, including the affected mapping actions, without an additional operation-specific authorization check.

  2. The selected token ID is stored from attacker-controlled POST data (ParticipantsAction.php:2674-2679):

    
    
    
    
    
    
    
    
  3. The mapped array is accepted directly from POST (ParticipantsAction.php:2494-2502):

    
    
    
    
    
    
    
    

    No allowlist verifies that each mapping value is a real token-table column name, and no numeric validation verifies that each mapping key is a legitimate CPDB attribute ID before the array reaches the model.

  4. The model forwards attacker-controlled mapping values into the SQL sink (Participant.php:2178-2181, Participant.php:2219-2222):

    
    
    
    
    
    
    
    
  5. The primary SQL injection sink is the raw SELECT expression (Participant.php:2036-2042):

    
    
    
    
    
    
    
    

    $tokenFieldname is attacker-controlled through mapped[<attribute-id>]=<value>.

  6. Yii preserves attacker-controlled SQL expressions containing parentheses (CDbCommand.php:604-625):

    
    
    
    
    
    
    
    

    Payloads such as (SELECT GROUP_CONCAT(... ) FROM lime_users) are therefore not quoted as column names.

  7. The query result is persisted into a participant attribute (Participant.php:2044-2066):

    
    
    
    
    
    
    
    
  8. The persisted value is exposed by a normal JSON endpoint (ParticipantsAction.php:2216-2271):

    
    
    
    
    
    
    
    

Confirmed source-to-sink path

  1. Source: authenticated POST request to:

    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral
  2. Request parameter:

    mapped[<visible-cpdb-attribute-id>]=<SQL expression>
    mapped[<visible-cpdb-attribute-id>]=<SQL expression>
    mapped[<visible-cpdb-attribute-id>]=<SQL expression>
    mapped[<visible-cpdb-attribute-id>]=<SQL expression>
  3. Controller: ParticipantsAction::addToCentral() passes mapped to Participant::copyToCentral().

  4. Model flow: Participant::copyToCentral() iterates over $aMapped.

  5. SQL sink: Participant::updateAttributeValueToken() calls select($tokenFieldname).

  6. Query builder behavior: CDbCommand::select() preserves strings containing ( as raw SELECT fragments.

  7. Persistence sink: the selected value is stored in {{participant_attribute}}.value.

  8. Exfiltration sink: ParticipantsAction::getParticipantsJson() returns visible CPDB attribute values.

Impact

An authenticated low-privileged user with participant panel access can evaluate SQL expressions in the context of the LimeSurvey database user and persist the result in a CPDB attribute visible through the application.

Confirmed impact from the submitted evidence:

  • Extraction of local LimeSurvey usernames and password hashes from lime_users.

  • Multi-row data aggregation using MySQL GROUP_CONCAT.

  • Delivery of the extracted result through the standard authenticated getParticipantsJson endpoint.

Potential impact:

  • Reading sensitive survey, participant, and administrative database data.

  • Reading credential hashes for offline cracking.

  • Modifying existing records in lime_participant_attribute through the secondary unsafe update condition if the attacker controls the mapping key:

PoC

Preconditions

  • LimeSurvey Community Edition 7.0.5+260623.

  • MySQL or MariaDB backend.

  • Application reachable at http://127.0.0.1:8081.

  • An authenticated user with access to the participants controller. The submitted PoC used:

    • participantpanel:read

    • surveys:create

    • auth_db:read

  • A visible CPDB attribute that can store the SQL expression result.

  • A survey participant token selected through the token-to-CPDB mapping workflow.

Reproduction Summary

  1. Deploy LimeSurvey 7.0.5.

  2. Create a constrained attacker account.

  3. Grant the attacker account participantpanel:read and enough permissions to create a self-contained test survey and log in locally.

  4. Create a visible CPDB attribute.

  5. Login as the attacker account.

  6. Create a survey and a survey participant token through normal LimeSurvey endpoints.

  7. Call:

    /index.php/admin/participants/sa/attributeMapToken?sid=<survey-id>
    /index.php/admin/participants/sa/attributeMapToken?sid=<survey-id>
    /index.php/admin/participants/sa/attributeMapToken?sid=<survey-id>
    /index.php/admin/participants/sa/attributeMapToken?sid=<survey-id>

    with:

    itemsid=[<token-id>
    itemsid=[<token-id>
    itemsid=[<token-id>
    itemsid=[<token-id>

    This stores the token ID in the server-side participantid session value.

  8. Call:

    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral
    /index.php/admin/participants/sa/addToCentral

    once with normal parameters to create or associate the CPDB participant.

  9. Call the same endpoint again with overwriteman=1 and a malicious mapping value:

    mapped[<visible-cpdb-attribute-id>
    mapped[<visible-cpdb-attribute-id>
    mapped[<visible-cpdb-attribute-id>
    mapped[<visible-cpdb-attribute-id>
  10. Call:

    /index.php/admin/participants/sa/getParticipantsJson
    /index.php/admin/participants/sa/getParticipantsJson
    /index.php/admin/participants/sa/getParticipantsJson
    /index.php/admin/participants/sa/getParticipantsJson

    and inspect the visible attribute cell in the JSON response.

Expected result:

  • The malicious mapping value is evaluated as a SQL expression.

  • The expression result is persisted as a CPDB participant attribute.

  • The JSON response contains username:password-hash rows from lime_users.

Evidence of Exploitation

  • Video of exploitation:

  • Static evidence:

Our security policy

We have reserved the ID CVE-2026-18403 to refer to this issue from now on.

Disclosure policy

System Information

  • LimeSurvey

  • Version: 7.0.5

  • Operating System: Any

References

Mitigation

An updated version of LimeSurvey is available on the vendor page.

Credits

The vulnerability was discovered by Miguel Gomez from Fluid Attacks' Offensive Team using the AI SAST Scanner.

Timeline

Vulnerability discovered

Vendor contacted

Vendor replied

Vendor requested re-testing

Follow-up with vendor

Vendor confirmed

Vulnerability patched

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.

As soluções da Fluid Attacks permitem que as organizações identifiquem, priorizem e corrijam vulnerabilidades em seus softwares ao longo do SDLC. Com o apoio de IA, ferramentas automatizadas e pentesters, a Fluid Attacks acelera a mitigação da exposição ao risco das empresas e fortalece sua postura de cibersegurança.

Consulta IA sobre Fluid Attacks

Assine nossa newsletter

Mantenha-se atualizado sobre nossos próximos eventos e os últimos posts do blog, advisories e outros recursos interessantes.

As soluções da Fluid Attacks permitem que as organizações identifiquem, priorizem e corrijam vulnerabilidades em seus softwares ao longo do SDLC. Com o apoio de IA, ferramentas automatizadas e pentesters, a Fluid Attacks acelera a mitigação da exposição ao risco das empresas e fortalece sua postura de cibersegurança.

Assine nossa newsletter

Mantenha-se atualizado sobre nossos próximos eventos e os últimos posts do blog, advisories e outros recursos interessantes.

Mantenha-se atualizado sobre nossos próximos eventos e os últimos posts do blog, advisories e outros recursos interessantes.

As soluções da Fluid Attacks permitem que as organizações identifiquem, priorizem e corrijam vulnerabilidades em seus softwares ao longo do SDLC. Com o apoio de IA, ferramentas automatizadas e pentesters, a Fluid Attacks acelera a mitigação da exposição ao risco das empresas e fortalece sua postura de cibersegurança.

Assine nossa newsletter

Mantenha-se atualizado sobre nossos próximos eventos e os últimos posts do blog, advisories e outros recursos interessantes.

Mantenha-se atualizado sobre nossos próximos eventos e os últimos posts do blog, advisories e outros recursos interessantes.