Skip to content

OS Command Injection

Critical
freescout-helpdesk published GHSA-7p9x-ch4c-vqj9 Mar 22, 2024

Package

No package listed

Affected versions

<1.8.128

Patched versions

1.8.128

Description

Description:

During the source Code Review of the Free Scout Application, an OS Command Injection has been identified in the /public/tools.php source file. The value of the php_path parameter is being executed as an OS command by the shell_exec function, without validating it. This allows an adversary to execute malicious OS commands on the server.

In a practical demonstration of the successful command injection attack extracted the /etc/passwd file of the server. This represented the complete compromise of the server hosting the freescout application.

This attack requires an attacker to know the App_Key of the application. This limitation makes the Attack Complexity to be High. If an attacker gets hold of the App_Key, the attacker can compromise the Complete server on which the application is deployed.

Impact:

The OS Command Injection vulnerability identified in the Free Scout Application poses a significant threat, allowing malicious actors to execute unauthorized commands on the server. The successful exploitation of this vulnerability could lead to a complete compromise of the server, resulting in a compromise of the confidentiality and integrity of the application, server, and its users and potential disruption of service.

Mitigation:

Implement robust input validation and sanitization mechanisms for the php_path parameter to ensure that only legitimate and safe commands are accepted. Also ensure that the provided php_path is a valid path and whether the php binary is present on that path or not, before executing the commands.

Steps to Reproduce:

  1. Go to /tools.php endpoint.
  2. Input the app key.
  3. Input “cat /etc/passwd;” in the php path.
  4. Press on any of the three buttons.
  5. The /etc/passwd file will be retrieved.

Evidence:

image

image

image

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-29185

Weaknesses

Credits