################################################################################
#
# COMPASS SECURITY ADVISORY
# https://www.compass-security.com/research/advisories/
#
################################################################################
#
# Product: Checkmk
# Vendor: tribe29 GmbH
# CSNC ID: CSNC-2020-005
# Subject: Local Privilege Escalation
# Risk: High
# Effect: Locally exploitable
# Authors: Thierry Viaccoz <thierry.viaccoz@compass-security.com>
# Date: 21.09.2020
#
################################################################################

Introduction:
————-
Checkmk [1] is an IT infrastructure monitoring software. It is consists of a
management server querying the clients and of an agent installed on the
monitored systems.

Compass Security identified a local privilege escalation vulnerability,
allowing a user on a systems monitored by Checkmk to escalate its privileges to
become a local administrator.

Affected:
———
Vulnerable:
* Checkmk 1.6.0p16

Not vulnerable:
* Checkmk 1.6.0p17

No other version was tested, but it is believed for the older versions to be
also vulnerable.

Technical Description:
———————-
Generally, a standard user can read and write to more paths than it should,
thereby allowing it to access and modifiy sensitive information.

Every user logged in on a system monitored by Checkmk can write to the path
where scripts are stored. These are executed regularly by the agent as SYSTEM:
C:ProgramDatacheckmkagentlocal>icacls .
. NT AUTHORITYSYSTEM:(I)(OI)(CI)(F)
BUILTINAdministrators:(I)(OI)(CI)(F)
CREATOR OWNER:(I)(OI)(CI)(IO)(F)
BUILTINUsers:(I)(OI)(CI)(RX)
BUILTINUsers:(I)(CI)(WD,AD,WEA,WA)

This means that the user can execute arbitrary commands as SYSTEM and escalate
its privileges. As a proof of concept, the script
“C:ProgramDatacheckmkagentlocalscript.bat” with the following content was
created:
@echo off
echo 0 myservice – OK: Custom output
whoami > C:checkmk.txt
net user /add compass [CUT]
net localgroup Administrators compass /add

The script first writes the current user with “whoami” in the file
“C:checkmk.txt”, then creates the new user “compass” and finally adds it in
the local “Administrators” group.

After several minutes, the script gets triggered by the monitoring server
through the local agent and the file “C:checkmk.txt” with the following
content is present:
nt authoritysystem

This shows that the script was executed as SYSTEM. In addition, the new local
administrator “compass” is present on the system.

A local attacker can exploit this vulnerability to gain local administrative
privileges on any system monitored by Checkmk.

Workaround / Fix:
—————–
Restrict the paths the users can read and write to the strict minimum in order
to prevent the scripts being tampered with and sensitive information like keys
to leak to unauthorized users. This was fixed by the publisher in [2].

As a Checkmk customer, update your installation to the latest version to
receive the fix.

Timeline:
———
2020-08-19: Discovery by Thierry Viaccoz
2020-08-24: Initial vendor notification
2020-08-31: Release of fixed version
2020-09-21: Coordinated public disclosure date

References:
———–
[1] https://checkmk.com/
[2] https://checkmk.com/check_mk-werks.php?werk_id=11460



Source link

Is your business effected by Cyber Crime?

If a cyber crime or cyber attack happens to you, you need to respond quickly. Cyber crime in its several formats such as online identity theft, financial fraud, stalking, bullying, hacking, e-mail fraud, email spoofing, invoice fraud, email scams, banking scam, CEO fraud. Cyber fraud can lead to major disruption and financial disasters. Contact Digitpol’s hotlines or respond to us online.

Digitpol’s Cyber Crime Investigation Unit provides investigative support to victims of cyber crimes. Digitpol is available 24/7. https://digitpol.com/cybercrime-investigation/

Europe +31558448040
UK +44 20 8089 9944
ASIA +85239733884