| id | security |
|---|---|
| title | Security |
| sidebar_label | Security |
You can run a quick built-in security review of your installation at any time by going to:
System configuration > Live Helper Chat update information (
system/update)
The Status/security checks table automatically highlights issues sorted by severity (errors first, then warnings, then passing checks) with direct links to the relevant settings. It reviews:
- Strong secret hash — checks that
secrethashis at least 50 characters long (see Secret hash). - Strong export hash — checks that
export_hashis either empty (export disabled) or at least 50 characters long (see Export hash). - Trusted host — checks that
trusted_host_patternsis configured (see Trusted hosts and Site address). - Site address & HTTPS — checks that
site_addressis set and useshttps://(see Trusted hosts and Site address). - Auto login — warns if auto login is enabled, flags weak autologin secrets (fewer than 32 characters), and shows the number of predefined login links (
user/autologinconfig). - Debug output — flags if
debug_outputis enabled insettings/settings.ini.php(see Debug). - iFrame embedding — warns if
allow_iframeis enabled (which setsSameSite=Noneon session cookies) and shows the configuredallow_iframe_domain. - Content Security Policy (CSP) — checks whether
cspis enabled, warns if it is inreport_onlymode, and shows whether violation logging is active (see Content Security Policy (CSP)). - Password policy — checks minimum password length (
>= 8), failed login attempt limit, password expiration, and login IP restriction (see Password requirements,user/passwordrequirements). - One login per account — checks whether
one_login_per_accountis enabled insettings/settings.ini.php. - Back office URL — checks whether the default
site_adminback-office URL indefault_admin_site_accesshas been replaced with a custom site access (see How to limit/protect back office access). - Administrators — reports the number of enabled administrator accounts and warns if any administrator still has autologin enabled (see Users,
user/userlist). - Rest API — reports active API keys, checks whether username/password Rest API login is disabled (
disable_rest_api_by_user), and warns if any API key user can still log in with a password or autologin (see Rest API,abstract/list/RestAPIKey). - Mobile app notifications — warns if mobile application / XML API access is enabled (
mobile/settings). - Log files public access — checks whether
cache/default.logis writable and verifies from the browser thatcache/default.logand rotated log files (default.log.1–default.log.5) are not publicly reachable over HTTP (see Nginx configuration tips).
Since version 3.97, the secret hash was too weak for modern security purposes. If you have an existing installation, I suggest changing it to a string of at least 50 characters. 80 characters is recommended, and the string should include special characters.
https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L12
In version 3.97, there are a few new settings. If you are missing them, you can add them to your settings/settings.ini.php file under the site section.
It will avoid Live Helper Chat in some circumstances generate URL pointing to third party website.
'site_address' => 'https://demo.livehelperchat.com',
'trusted_host_patterns' => [
'^demo\.livehelperchat\.com$', // Explicit domain
'^.+\.livehelperchat\.com$', // Any subdomain
],Location in default configuration
https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L39
https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L48-L49
Few things
- Remove
index.phpfrom URL - Limit what URL's are exposed to the public, nginx example
- Disable mobile app access. In
mobile/settingsdo not enableEnable mobile application and mobile notifications - Disable
disable_rest_api_by_userIt will disable mobile app also. - Limit Rest API and
site_adminvia apache E.g
<Location "/site_admin/">
SetEnvIf X-Forwarded-For "192.168.1.2" Remi
<RequireAny>
Require env Remi
Require ip 192.168.1.2/32
</RequireAny>
</Location>
#Allow sso for crm
<Location ~ "/site_admin/ssoprovider/.*">
SetEnvIf X-Forwarded-For "192.168.1.2" Remi
<RequireAny>
Require env Remi
Require ip 192.168.1.2/32
</RequireAny>
</Location>
#Allow Rest API
<Location ~ "/restapi/.*">
SetEnvIf X-Forwarded-For "192.168.1.2" Remi
<RequireAny>
Require env Remi
Require ip 192.168.1.2/32
</RequireAny>
</Location>- Change default back office url
site_adminto something else. This step has to be done after an installation. Before doing any changes please disable cache- Change
site_adminto something else in https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L35 - Change
site_adminto something else in https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L97 - Change
site_adminto something else in https://github.com/LiveHelperChat/livehelperchat/blob/5cc78ea50bb5dcbce325f3cee61d21f7aa04e5d5/lhc_web/settings/settings.ini.default.php#L790
- Change
- Clear cache after those steps
As with secrethash, the same situation applies to the Export hash.
The Export hash can be changed in:
System configuration > Live Help configuration > Chat configuration > Misc > Chats export secret hash
Set it to a length of at least 50 characters.
Live Helper Chat sends a Content-Security-Policy HTTP header on private (permission-protected) and back-office routes.
frame-ancestors 'self'(plusallow_iframe_domainif configured) is sent on all permission-protected andsite_adminroutes to prevent clickjacking, together withX-Content-Type-Options: nosniff(prevents MIME-sniffing) andReferrer-Policy: strict-origin-when-cross-origin(prevents leaking admin paths, chat IDs, and query parameters inRefererheaders).- On routes that require user permissions,
script-src,style-src,connect-src,worker-src,object-src,base-uri, andform-actiondirectives are also enforced by default to restrict where JavaScript, CSS, AJAX/WebSocket requests, Web Workers, plugins/objects, base URLs, and form submissions can be loaded from or sent to.
CSP is enabled by default even if the csp block is not yet present in your settings/settings.ini.php. To customize or disable it, add the csp array under the site section:
'csp' => array(
'enabled' => true,
'report_only' => false,
'log_violations' => true,
'script_src' => "'self' 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com",
'style_src' => "'self' 'unsafe-inline' https://fonts.googleapis.com",
'connect_src' => "'self' https://maps.googleapis.com",
'worker_src' => "'self' blob:",
'object_src' => "'none'",
'base_uri' => "'self'",
'form_action' => "'self'",
),How each setting works:
enabled— set tofalseto disablescript-src,style-src,connect-src,worker-src,object-src,base-uri, andform-action(frame-ancestors,X-Content-Type-Options, andReferrer-Policyremain active).report_only— set totrueto sendscript-src,style-src,connect-src,worker-src,object-src,base-uri, andform-actioninContent-Security-Policy-Report-Onlyinstead of blocking (useful for troubleshooting custom extensions), while keepingframe-ancestorsenforced inContent-Security-Policy.log_violations— enabled by default (true); addsreport-uripointing toaudit/logjserrorand stores browser CSP violation reports in the Audit log under thecspcategory (works in both enforced andreport_onlymodes). Set tofalseto disable.script_src— allows external<script src="...">files only from the same origin ('self') and Google Maps (https://maps.googleapis.com).'unsafe-inline'and'unsafe-eval'are included because Live Helper Chat templates and AngularJS rely on inline scripts and expression evaluation. Any script from another domain is blocked.style_src— allows external stylesheets only from'self'andhttps://fonts.googleapis.com(injected by the Google Maps JS API), while permitting inline<style>tags andstyle="..."attributes ('unsafe-inline').connect_src— restrictsXMLHttpRequest(AJAX),fetch(),WebSocket,EventSource, andsendBeacon()calls to'self'andhttps://maps.googleapis.com.worker_src— restricts Web Workers to'self'andblob:(required by voice message MP3/WASM encoding and the Ace editor).object_src— defaults to'none'to block<object>,<embed>, and<applet>elements.base_uri— defaults to'self'to prevent injected<base>tags from hijacking relative URLs.form_action— defaults to'self'to prevent redirecting form submissions to external domains.- Setting any directive (
script_src,style_src,connect_src,worker_src,object_src,base_uri, orform_action) to an empty string ('') omits that directive from the header.
If your installation uses features or extensions that communicate with external origins from the browser, append those origins to the corresponding directive in settings/settings.ini.php:
- NodeJS / Centrifugo / WebSocket helper on a separate subdomain or port: add its origin (for example
wss://ws.example.com) toconnect_src. - Custom admin themes, fonts, CDNs, or extensions: add their domains to
script_src,style_src, orconnect_srcas needed.
Individual module views (including custom extensions) can append origins only for that specific route by defining a csp array in $ViewList inside module.php. For example, system/update allows https://livehelperchat.com in connect_src only on the update page rather than globally:
$ViewList['update'] = array(
'params' => array(),
'uparams' => array('action','scope'),
'functions' => array( 'performupdate' ),
'csp' => array(
'connect_src' => 'https://livehelperchat.com'
)
);Visitors can include BBCode tags directly in chat messages. Disabling tags that visitors do not need reduces the risk of external tracking images ([img]), phishing or malicious links ([url]), unwanted embeds ([youtube]), or spoofed interactive elements in the operator back office.
You can configure BBCode restrictions in:
System configuration > Live Help configuration > Automation > BBCode configuration (
system/bbcode)
For each BBCode tag you can independently check:
- Disable for visitor messages — prevents the tag from being rendered in visitor messages and hides it from the visitor BBCode toolbar.
- Disable for operator messages — prevents the tag from being rendered in operator messages and hides it from the operator editor toolbar.
Common tags to consider disabling for visitors if you do not need them:
[img]— prevents visitors from embedding external images (which can leak operator IP addresses or trigger external requests).[url]— disables clickable[url]links from visitors.[youtube]— prevents embedded YouTube iframes.[paypal],[link_trigger],[button_action],[survey],[fupload],[baseurl],[loc]— interactive or system-oriented tags generally meant for operators/bots rather than visitors.
Under the [url] option on the same BBCode configuration page, you can configure a domain whitelist for visitor messages:
example.com,support.example.org||⚠️ Disallowed Link ⚠️: {url}
- List allowed domains separated by commas (subdomains of listed domains are also allowed).
- Append
||followed by a message template containing{url}as the placeholder. - Any URL in a visitor message that does not match the whitelist is automatically defanged (
https[:]//and[.]) and displayed with your placeholder instead of a clickable link.
To avoid exposing server paths, environment variables, $_SERVER contents, database configuration (SHOW variables), and phpinfo() in the back office (audit/configuration), those sections are hidden by default — even for users with the lhaudit -> see_system permission.
They are only displayed when expose_env is configured in settings/settings.ini.php under the site section with explicit allowed IP addresses or IP ranges, and the current operator's IP matches:
'expose_env' => '', // Default: hidden for all IPs. E.g. '127.0.0.1,192.168.1.0/24'Leave expose_env empty ('') in production, or restrict it strictly to trusted administrator IPs while troubleshooting. See Debugging Application: Exposing Environment Information for supported IP range formats and usage details.