Adobe Commerce (formerly known as Magento) is an open-source e-commerce platform providing a robust set of tools for online merchants to manage their online stores. Unfortunately, Adobe Commerce versions 2.4.6-p1 (and earlier), 2.4.5-p3 (and earlier), and 2.4.4-p4 (and earlier) have been found to contain a critical vulnerability, specifically an OS Command Injection issue, which allows admin-privilege authenticated attackers to execute arbitrary code on the targeted server. This issue, identified as CVE-2023-38208, does not require any user interaction to be exploited, making it a high-risk vulnerability for affected systems.

Technical Details

This vulnerability, named 'Improper Neutralization of Special Elements used in an OS Command,' occurs when the application does not correctly filter or sanitize special characters and control sequences in user input before incorporating them into commands executed by the underlying operating system. As a result, a malicious attacker with admin-privileges can inject and execute arbitrary commands on the server.

Here's a simple code snippet demonstrating the vulnerability

$command = "bash -c 'echo " . $_GET['payload'] . "'";
$result = shell_exec($command);

In the code above, an attacker might use a payload like "; rm -rf /" to inject a command for deletion into the executed command string, causing unintended consequences.

To exploit this vulnerability, an attacker would typically follow these steps

1. Obtain valid admin-privilege credentials, either through phishing, social engineering, or other means.
2. Identify the vulnerable Adobe Commerce versions being used, which are 2.4.6-p1 and earlier, 2.4.5-p3 and earlier, and 2.4.4-p4 and earlier.
3. Craft a malicious payload that takes advantage of the OS Command Injection vulnerability and injects arbitrary commands.
4. Inject the payload into the Adobe Commerce application, causing the server to execute the arbitrary commands.

Please note that this vulnerability allows for remote code execution on the affected servers, which implies gaining full control over the server and its contents, including sensitive user data and payment information.

References

- CVE-2023-38208 - National Vulnerability Database
- Adobe Security Bulletin

Recommendations

To mitigate the risks posed by this vulnerability, it is strongly recommended that users of affected Adobe Commerce versions update to the latest security patches as soon as possible. Adobe has released patches for these versions:

Adobe Commerce 2.4.4-p5

In addition to patching the vulnerability, administrators should enforce strong access control policies by restricting admin-privilege access to trusted users and implementing two-factor authentication (2FA) for any user with elevated privileges.

Timeline

Published on: 08/09/2023 08:15:00 UTC
Last modified on: 08/15/2023 00:53:00 UTC