Skip to content

Remote Command Execution in Logging

Low
connortechnology published GHSA-rpwp-cr82-f2p3 Aug 12, 2024

Package

zoneminder

Affected versions

<= 1.36.33, <= 1.37.33

Patched versions

1.36.34, 1.37.42

Description

Impact

The path to write logs to can be set to "/usr/share/zoneminder/www/lang" (where the languages are located). You can give any name to the file as long as it has a ".php" extension (because Zm checks if the "language".php exist in the language path), in this case for example "rce.php".
Change the settings of any user on the platform and enter as the value of the "Home View" a payload in php that executes a command such as "$output"; ?>"
Set as the language of this user, the log file that was created earlier, in this case "rce.php". (By intercepting and modifying the request, bypassing the client side control of the language you can choose)
The application will log everything that was done in the file "rce.php" including the php payload so it was possible to poison the log.
Finally you then just have to log in with that user and instead of the home, you will be presented with the log file with the output of the php payload command that was injected earlier inside and you can then execute any command on the remote machine.

Patches

Release 1.36.34 will contain the fixes. Fixed by:
c83f179

Workarounds

Users must upgrade

Severity

Low

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
High
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

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:H/UI:N/S:U/C:L/I:N/A:N

CVE ID

CVE-2023-31493

Weaknesses

No CWEs