CVE-2026-73847: Emlog: Missing CSRF protection in AI Assistant execute_tool leads to full database compromise and admin account takeover
Emlog is an open source website building system. In 2.6.26 and earlier, missing CSRF protection on the AI Assistant executetool action in admin/ai.php lets a remote unauthenticated attacker submit a forged cross-site request from an attacker-controlled page to a recently logged-in administrator. The authentication cookie set in include/lib/loginauth.php has no explicit SameSite attribute, enabling Chrome's temporary Lax+POST grace window. The querydatabase case passes attacker-controlled sql and confirmcode values to Ai::queryDatabase in include/service/ai.php; read queries need no confirmation, write queries accept the public confirm string, only the blog table is write-protected, and aliasing password as pwdhash bypasses output redaction. A successful request can read every database table and write every table except blog, including changing the user table to take over an administrator account. No fixed version is available as of this review.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Add/enable CSRF protection for the AI Assistant execute_tool action in admin/ai.php. In Emlog versions 2.6.26 and earlier, ensure requests to execute_tool cannot be forged via cross-site requests from attacker-controlled pages.
Emlog AI Assistant execute_tool (admin/ai.php) CSRF protection requirement for execute_tool action = enabled - Configuration
Set an explicit SameSite attribute on the authentication cookie in include/lib/loginauth.php to prevent Chrome’s temporary Lax+POST grace window from allowing cross-site POST/CSRF abuse after an administrator login.
Emlog authentication cookie (include/lib/loginauth.php) SameSite attribute = set explicit SameSite attribute (e.g., SameSite=Strict/Lax with no temporary Lax+POST grace window) - Configuration
In include/service/ai.php (Ai::queryDatabase), stop passing attacker-controlled sql and confirm_code values from the query_database case. Enforce strict validation/deny-listing and ensure attacker-controlled values cannot be used to perform arbitrary read/write queries (including any ability to change the user table).
Emlog AI Assistant database query (include/service/ai.php) SQL input handling for Ai::queryDatabase = reject/deny attacker-controlled sql and confirm_code - Configuration
Fix the query_database handling so that write operations cannot proceed using only the public confirm string, and ensure password/pwd_hash redaction cannot be bypassed via aliasing (e.g., password as pwd_hash) to avoid output redaction.
Emlog AI Assistant database query (include/service/ai.php) Write query confirmation and password field redaction logic = enforce strong server-side authorization/redaction; do not allow pwd_hash aliasing bypass
Event History
Frequently Asked Questions
What is CVE-2026-73847?
CVE-2026-73847 is a vulnerability in Emlog due to missing CSRF protection that can lead to full database compromise and admin account takeover.
What is the severity of CVE-2026-73847?
CVE-2026-73847 has a medium severity score of 6.8.
How do I fix CVE-2026-73847?
To fix CVE-2026-73847, update Emlog to version 2.6.27 or later where the CSRF protection issue has been addressed.
Who is affected by CVE-2026-73847?
The vulnerability affects users of Emlog versions 2.6.26 and earlier who have the AI Assistant feature enabled.
What can an attacker achieve with CVE-2026-73847?
An attacker can use CVE-2026-73847 to execute unauthorized actions as an admin, potentially leading to complete control over the database.