CVE-2024-50333
Executive Summary
CVE-2024-50333 is a critical vulnerability in SuiteCRM, an open-source CRM application. The flaw resides in the ParserLabel::addLabels() function, which fails to validate user input before writing it to a custom language file. This allows an authenticated attacker to inject arbitrary content into the file, which is then included at runtime. Successful exploitation could lead to code execution, data manipulation, or other malicious activities. The vulnerability affects versions prior to 7.14.6 and 8.7.1. No public proof-of-concept (PoC) or exploit code is currently available, and the EPSS score is 0.0%, indicating low exploitation activity. However, the potential impact is significant, and immediate patching is recommended.
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
SuiteCRM is a PHP-based application distributed via GitHub and its official website. The vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a direct code flaw. Users should verify the integrity of their SuiteCRM installation and ensure they are using official sources.
CVSS Breakdown & Threat Level
- CVSS Score: 6.6 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low (L) - No special conditions are required.
- Privileges Required (PR): Low (L) - An attacker needs a valid user account.
- User Interaction (UI): None (N) - No user action is needed.
- Scope (S): Unchanged (U) - The vulnerable component and the impacted component are the same.
- Confidentiality (C): Low (L) - Limited information disclosure.
- Integrity (I): Low (L) - Limited data modification.
- Availability (A): Low (L) - Limited service disruption.
Threat Level: Medium. While the CVSS score is 6.6, the ability to write arbitrary content to a runtime-included file elevates the risk. An attacker could potentially escalate this to full code execution.
Deep Dive & Mechanics
The vulnerability is a classic case of improper input validation (CWE-20). The ParserLabel::addLabels() function is designed to allow administrators to add custom language labels to the CRM. However, it does not sanitize or validate the user-supplied label values before writing them to a PHP file on the filesystem.
How it works:
- An authenticated user with appropriate privileges (e.g., an admin) accesses the label management functionality.
- The user submits a new label with a key and a value.
- The
addLabels()function takes the value and writes it directly into a custom language file (e.g.,custom/Extension/modules/Accounts/Ext/Language/en_us.custom.php). - This file is then included by SuiteCRM during runtime to load the custom labels.
- An attacker can inject PHP code into the label value. For example, a value like
'; system($_GET['cmd']); //would be written to the file. - When the file is included, the injected PHP code is executed, giving the attacker control over the server.
Root Cause: The lack of input validation and the direct inclusion of user-controlled data into a PHP file.
Vulnerable vs. Patched Code
Vulnerable Code (Example from SuiteCRM < 7.14.6 / < 8.7.1):
// In ParserLabel.php
public function addLabels($labels, $module, $language = 'en_us')
{
// ... some code ...
$contents = "<?php\n// created: " . date('Y-m-d H:i:s') . "\n";
foreach ($labels as $key => $value) {
// No validation of $value
$contents .= "\$app_list_strings['$module']['$key'] = '$value';\n";
}
// ... write $contents to file ...
}
Patched Code (SuiteCRM 7.14.6 / 8.7.1):
// In ParserLabel.php
public function addLabels($labels, $module, $language = 'en_us')
{
// ... some code ...
$contents = "<?php\n// created: " . date('Y-m-d H:i:s') . "\n";
foreach ($labels as $key => $value) {
// Validate and sanitize $value
$value = addslashes($value); // Or use a more robust sanitization
$contents .= "\$app_list_strings['$module']['$key'] = '$value';\n";
}
// ... write $contents to file ...
}
The patched code uses addslashes() to escape special characters, preventing PHP injection. A more secure approach would be to use var_export() or a dedicated sanitization function.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A valid SuiteCRM user account with admin privileges.
- Network access to the SuiteCRM instance.
Steps:
- Login: Authenticate to SuiteCRM as an admin.
- Navigate to Label Management: Go to
Admin -> Studio -> [Any Module] -> Labels. - Add Malicious Label: Create a new label with a key (e.g.,
x) and a value containing PHP code. For example:- Key:
x - Value:
'; system($_GET['cmd']); //
- Key:
- Save: Submit the label. The malicious code is written to the custom language file.
- Trigger Execution: Access any page that includes the custom language file. Then, execute commands by appending
?cmd=idto the URL.
Example Payload:
'; echo shell_exec($_GET['c']); //
Lab Setup:
- Environment: Docker container running SuiteCRM 7.14.5.
- Tools: Burp Suite, browser, netcat.
- Steps:
- Deploy SuiteCRM using the official Docker image.
- Create an admin user.
- Use Burp Suite to intercept and modify the label submission request.
- Inject the payload.
- Verify code execution by accessing a page and passing the
cparameter.
Blue Team (Defender)
Detection:
- Monitor for unusual label creation or modification events.
- Look for PHP code in label values.
- Check for unexpected files in the
custom/Extension/directory.
Prevention:
- Apply the patch immediately.
- Implement Web Application Firewall (WAF) rules to block PHP code in input fields.
- Restrict admin privileges to trusted users only.
Response:
- If exploitation is suspected, isolate the server.
- Review logs for suspicious activity.
- Remove any malicious custom language files.
- Reset all admin passwords.
Indicators of Compromise (IOCs)
- File System:
- Unexpected PHP files in
custom/Extension/modules/*/Ext/Language/. - Files containing PHP code like
system(),shell_exec(),eval(), etc.
- Unexpected PHP files in
- Network:
- Outbound connections from the SuiteCRM server to unknown IPs.
- Unusual HTTP requests with
cmdor similar parameters.
- Logs:
- SuiteCRM audit logs showing label creation with suspicious values.
- Web server logs showing requests to pages with injected parameters.
Detection Engineering
YARA Rule
rule CVE_2024_50333_SuiteCRM_Label_Injection {
meta:
description = "Detects PHP code injection in SuiteCRM custom language files"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-50333"
strings:
$php_code = /system\(|shell_exec\(|exec\(|passthru\(|eval\(/
$label_file = /custom\/Extension\/modules\/.*\/Ext\/Language\/.*\.php/
condition:
$label_file and $php_code
}
Sigma Rule
title: SuiteCRM Custom Language File PHP Injection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects creation of custom language files containing PHP code in SuiteCRM
author: Valters IT
date: 2024-01-01
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|contains: 'custom/Extension/modules/'
TargetFilename|endswith: '.php'
TargetFilename|contains: 'Ext/Language/'
condition: selection
falsepositives:
- Legitimate custom language file creation by administrators
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-50333 SuiteCRM Label Injection"; flow:to_server,established; content:"POST"; http_method; content:"/index.php"; http_uri; content:"entryPoint=SaveLabel"; http_client_body; pcre:"/(system|shell_exec|exec|passthru|eval)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade SuiteCRM: Update to version 7.14.6 or 8.7.1 immediately.
- Review Custom Files: Check the
custom/Extension/directory for any suspicious files and remove them. - Change Admin Passwords: Reset all admin account passwords.
Long-Term Mitigations:
- Implement strict input validation for all user-supplied data.
- Use a Web Application Firewall (WAF) to filter malicious input.
- Regularly audit SuiteCRM installations for vulnerabilities.
- Follow the principle of least privilege for user accounts.
Workarounds:
- No official workarounds are available. Patching is the only solution.
Report generated by Valters IT DevSecOps & CTI Division