CVE-2026-32813: Admidio: Second-Order SQL Injection via List Configuration (lsc_special_field, lsc_sort, lsc_filter)
Summary
The MyList configuration feature in Admidio allows authenticated users to define custom list column layouts. User-supplied column names, sort directions, and filter conditions are stored in the admlistcolumns table via prepared statements (safe storage), but are later read back and interpolated directly into dynamically constructed SQL queries without sanitization or parameterization. This is a classic second-order SQL injection: safe write, unsafe read.
An attacker can inject arbitrary SQL through these stored values to read, modify, or delete any data in the database, potentially achieving full database compromise.
Details
Step 1: Storing the Payload (Safe Write)
In modules/groups-roles/mylistfunction.php (lines 89-115), user-supplied POST array values for column names, sort directions, and filter conditions are accepted. The only validation on column values is a prefix check (must start with usr or mem). Sort and condition values have no validation at all. These values are stored in the database via ListConfiguration::addColumn() which calls Entity::save() using prepared statements -- so the INSERT/UPDATE is safe.
Key source file references: - D:\bugcrowd\admidio\repo\modules\groups-roles\mylistfunction.php lines 89-115 - D:\bugcrowd\admidio\repo\src\Roles\Entity\ListConfiguration.php lines 106-116
Step 2: Triggering the Payload (Unsafe Read)
When the list is viewed (via listsshow.php), ListConfiguration::getSql() reads the stored values and interpolates them directly into SQL in four locations:
Injection Point 1 -- lscspecialfield in SELECT clause: File D:\bugcrowd\admidio\repo\src\Roles\Entity\ListConfiguration.php lines 739-770. The lscspecialfield value is read from the database and used as a column name in the SELECT clause. Only three values (memduration, membegin, memend) get special handling; all others fall through to the default case where the raw value is used directly as both $dbColumnName and $sqlColumnName, then interpolated into the SQL as $dbColumnName AS $sqlColumnName.
Injection Point 2 -- lscsort in ORDER BY clause: File D:\bugcrowd\admidio\repo\src\Roles\Entity\ListConfiguration.php lines 790-792. The lscsort value is appended directly after the column name in the ORDER BY clause.
Injection Point 3 -- lscspecialfield in search conditions: File D:\bugcrowd\admidio\repo\src\Roles\Entity\ListConfiguration.php lines 611-621. The lscspecialfield value is interpolated into COALESCE() expressions used in search WHERE conditions.
Injection Point 4 -- lscfilter via ConditionParser: File D:\bugcrowd\admidio\repo\src\Roles\ValueObject\ConditionParser.php line 347. The ConditionParser appends raw characters from the stored filter value to the SQL string. A single quote can break out of the SQL string context.
Root Cause
The addColumn() method and mylistfunction.php accept arbitrary strings for column names, sort directions, and filter conditions. The only gate for column names is a prefix check (usr or mem), which is trivially satisfied by an attacker (e.g., usrid) UNION SELECT ...). No allowlist of valid column names exists. No server-side validation of sort values exists (should only allow ASC/DESC/empty). The frontend <select> element only offers ASC/DESC, but this is trivially bypassed by POSTing arbitrary values.
PoC
Prerequisites: Logged-in user with list edit permission (default: all logged-in users).
Step 1: Save a list config with SQL injection in lscspecialfield
curl -X POST "https://TARGET/admprogram/modules/groups-roles/mylistfunction.php?mode=savetemporary" \ -H "Cookie: ADMIDIOSESSIONID=<session>" \ -d "admcsrftoken=<csrftoken>" \ -d "column[]=usrloginname" \ -d "column[]=usrid FROM admusers)--" \ -d "sort[]=" \ -d "sort[]=" \ -d "condition[]=" \ -d "condition[]=" \ -d "selroles[]=<validroleuuid>"
The second column value usrid FROM admusers)-- starts with usr so it passes the prefix check. When read back in getSql(), it is interpolated directly as a column expression in the SQL SELECT clause.
Step 2: Sort-based injection (simpler, no prefix check needed)
curl -X POST "https://TARGET/admprogram/modules/groups-roles/mylistfunction.php?mode=savetemporary" \ -H "Cookie: ADMIDIOSESSIONID=<session>" \ -d "admcsrftoken=<csrftoken>" \ -d "column[]=usrloginname" \ -d "sort[]=ASC,(SELECT+CASE+WHEN+(1=1)+THEN+1+ELSE+1/0+END)" \ -d "condition[]=" \ -d "selroles[]=<validroleuuid>"
This injects into the ORDER BY clause. The sort value has zero server-side validation.
Step 3: The savetemporary mode automatically redirects to listsshow.php which calls ListConfiguration::getSql(), executing the injected SQL.
Impact
- Data Exfiltration: An attacker can extract any data from the database including password hashes, email addresses, personal data of all members, and application configuration. - Data Modification: With stacked queries (supported by MySQL with PDO), the attacker can modify or delete data. - Privilege Escalation: Password hashes can be extracted and cracked, or admin accounts can be directly modified. - Full Database Compromise: The entire database is accessible through this vulnerability.
The attack requires authentication and CSRF token, but: 1. Any logged-in user has this permission by default (when groupsroleseditlists = 1). 2. The CSRF token is available in the same session. 3. The injected payload persists in the database and triggers every time anyone views the list.
Recommended Fix
Fix 1: Allowlist for lscspecialfield
Add a strict allowlist of valid special field names before calling addColumn() in mylistfunction.php. The list should match exactly the field names supported in getSql() and the JavaScript on mylist.php.
Fix 2: Validate lscsort values
In ListConfiguration::addColumn(), validate that the sort parameter is one of ASC, DESC, or empty string before storing it.
Fix 3: Defense-in-depth validation in ListConfiguration::getSql()
Also validate the lscspecialfield value against an allowlist in getSql() before interpolating it into the SQL string. This protects against payloads already stored in the database.
Fix 4: Escape filter values in ConditionParser
Use parameterized queries or at minimum escape single quotes in ConditionParser::makeSqlStatement().
Other sources
Admidio is an open-source user management solution. Versions 5.0.6 and below are vulnerable to arbitrary SQL Injection through the MyList configuration feature. The MyList configuration feature lets authenticated users define custom list column layouts, storing user-supplied column names, sort directions, and filter conditions in the admlistcolumns table via prepared statements. However, these stored values are later read back and interpolated directly into dynamically constructed SQL queries without sanitization or parameterization, creating a classic second-order SQL injection vulnerability (safe write, unsafe read). An attacker can exploit this to inject arbitrary SQL, potentially reading, modifying, or deleting any data in the database and achieving full database compromise. This issue has been fixed in version 5.0.7.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-32813?
CVE-2026-32813 is considered to have a moderate severity level due to the potential for unauthorized data manipulation.
How do I fix CVE-2026-32813?
To fix CVE-2026-32813, upgrade to Admidio version 5.0.7 or later.
Who is affected by CVE-2026-32813?
CVE-2026-32813 affects users of Admidio versions up to and including 5.0.6.
What are the potential impacts of CVE-2026-32813?
The potential impacts of CVE-2026-32813 include unauthorized modification of custom list configurations.
Is CVE-2026-32813 exploitation easy?
Exploitation of CVE-2026-32813 requires authenticated access, making it more challenging for attackers.