Live Helper Chat: SQL Injection in the Chat Archive Listing via the Archive ID in the URL Path
The sort expression of the chat archive listing concatenates the archive ID from the URL path into an SQL identifier; an operator holding the single archive permission reads the database and runs stacked statements.
Advisory ID: TP-2026-146
Product: Live Helper Chat (open-source live chat software for customer support on websites)
Vulnerability type: SQL injection (CWE-89)
CVE: not requested
CVSS 3.1: 8.8 (High) · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Vendor advisory: GHSA-mhxj-3vw8-cm6w
Affected versions: up to and including 4.94v (verified live: commit d8787d04)
Fixed in: 4.95v
Reported: 10 October 2026
Summary
Live Helper Chat is open-source live chat software for customer support on websites; closed chats can be moved into archive tables and listed through chatarchive/listarchivechats. That view builds its sort expression by concatenating the archive ID from the URL path into a backtick-quoted identifier. The path segment is neither cast to a number nor validated, and the assignment overwrites the value that the allowlist of the search layer set before. Because ATTR_EMULATE_PREPARES is set nowhere, the PDO default applies and a statement separator executes a second statement. An operator holding the single archive permission reads every table in the database and writes to it, including a grant of all permissions to the operator's own role.
Root cause
lhc_web/modules/lhchatarchive/listarchivechats.php:26 concatenates $Params['user_parameters']['id'] into the sort expression '`lh_chat_archive_' . $id . '` . `id` DESC', and the same raw segment reaches further identifiers on lines 19, 30 and 31.
lhc_web/lib/core/lhcore/lhmodule.php:33 takes the path segment from ezcUrl::getParam() into $Params['user_parameters'] with no cast and no validation.
Two lines above, $archive->setTables() (lhc_web/modules/lhchatarchive/listarchivechats.php:24) has already derived the correct table name from the loaded archive record, and that value stays unused.
lhc_web/lib/core/lhcore/lhsearchhandler.php:512 assigns $filter['sort'] from a fixed allowlist, and lhc_web/modules/lhchatarchive/listarchivechats.php:26 overwrites that assignment afterwards.
lhc_web/modules/lhmailarchive/listarchivemails.php:26 builds the same expression from Conversation::$dbTable instead of the URL, and ATTR_EMULATE_PREPARES is set nowhere, so a statement separator executes a second statement.
Proof of Concept
GET /index.php/site_admin/chatarchive/listarchivechats/1`.`id`%20DESC,%20(SELECT%20SLEEP(0))%20--%20a 200 0.045 s
GET /index.php/site_admin/chatarchive/listarchivechats/1`.`id`%20DESC,%20(SELECT%20SLEEP(3))%20--%20a 200 3.038 s
GET /index.php/site_admin/chatarchive/listarchivechats/1`.`id`%20DESC,%20(SELECT%20SLEEP(6))%20--%20a 200 6.040 s
GET /index.php/site_admin/chatarchive/listarchivechats/1%60.%60id%60;%20INSERT%20INTO%20lh_rolefunction%20(role_id,type,module,function,limitation)%20VALUES%20(4,0,'*','*','')%20--%20a
200 in 0.042 s
The backtick in the path segment closes the identifier and the rest lands in ORDER BY; the response time follows the SLEEP value, and the stacked statement grants the attacker's role every module and function, effective after a re-login. Verified on 4.94v (commit d8787d04) in Docker with MariaDB 10.6.28 and MySQL 5.7.44 in the default configuration; the attacker's role holds exactly one permission, lhchatarchive / archive, and an archive must already exist. Without the backtick the server answers 503 with no delay.
Impact
- Full read of the application database, including bcrypt password hashes and the SMTP credentials stored in
lh_chat_config. - Arbitrary write through stacked statements, demonstrated as a self-grant of all modules and functions, which yields administrator access after a re-login.
- Arbitrary deletion through the same primitive.
- The timing oracle and the stacked write leave no
lh_auditsrow.
References
Is Something Like This in Your Software?
Our team found this vulnerability during its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.
