GHSA-c279-989m-238f: Sliver Nil Pointer Dereference Vulnerability

HIGH
CWE-476
Published
Advisory Summary

GHSA-c279-989m-238f is a HIGH nil pointer dereference vulnerability (CWE-476: NULL Pointer Dereference) affecting Sliver libraries in the Go ecosystem. The issue involves nil pointer dereference in tunnelclosehandler causes panic when a reverse tunnel (rportfwd) close is attempted. Remediation is available in the latest vendor maintenance releases.

GHSA-c279-989m-238f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c279-989m-238f
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Sliver
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-c279-989m-238f

To remediate this vulnerability, upgrade all affected 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: Latest secure release
Upgrade github.com/bishopfox/sliver to Latest secure release
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 GHSA-c279-989m-238f, inspect your project dependencies for Sliver:

inspect dependencies for github.com/bishopfox/sliver

Analyze the terminal output to locate any version of Sliver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In 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

### Summary A nil pointer dereference in `tunnelCloseHandler` causes the handler goroutine to panic whenever a reverse tunnel (rportfwd) close is attempted. Both the legitimate close path AND the unauthorized close path dereference `tunnel.SessionID` where `tunnel` is guaranteed nil. This means rportfwd tunnels can never be cleanly closed, and any authenticated implant can trigger repeated goroutine panics. ### Details File: `server/handlers/sessions.go` lines 172 and 175 The function enters an `else` block precisely because `core.Tunnels.Get(tunnelData.TunnelID)` returned `nil`. Both conditions inside that else block then dereference `tunnel.SessionID` instead of `rtunnel.SessionID`: ```go } else { rtunnel := rtunnels.GetRTunnel(tunnelData.TunnelID) if rtunnel != nil && session.ID == tunnel.SessionID { // LINE 172 — nil deref rtunnel.Close() rtunnels.RemoveRTunnel(rtunnel.ID) } else if rtunnel != nil && session.ID != tunnel.SessionID { // LINE 175 — nil deref sessionHandlerLog.Warnf("...") } } ``` Note: The identical bug was already fixed in `tunnelDataHandler` at lines 124/126 (correctly uses `rtunnel.SessionID`), but the fix was not applied to `tunnelCloseHandler`. ### PoC ```go tunnel := GetTunnel(999) // returns nil — no normal tunnel with this ID // tunnel is nil here rtunnel := GetRTunnel(999) // returns valid rtunnel owned by session-AAAA // Both lines below panic with: // runtime error: invalid memory address or nil pointer dereference if rtunnel != nil && sessionID == tunnel.SessionID { ... } // line 172 } else if rtunnel != nil && sessionID != tunnel.SessionID { ... } // line 175 ``` Confirmed on master commit `7ac4db3fa` with standalone reproducer. Output: ``` PANIC on line 172 (legitimate close): runtime error: invalid memory address or nil pointer dereference PANIC on line 175 (unauthorized close): runtime error: invalid memory address or nil pointer dereference ``` ![1](https://github.com/user-attachments/assets/93b24286-3282-454f-80a4-b01abe4f1d63) ![2](https://github.com/user-attachments/assets/d4219aea-eb18-474c-b69a-a5e20e97161f) ![3](https://github.com/user-attachments/assets/5a76b0d7-ae5b-4d91-bfe9-730d3e5c322c) ### Impact - rportfwd tunnels **cannot be closed** — functional regression - Any authenticated implant can trigger repeated handler goroutine panics - rtunnel map entries leak (never cleaned up on close failure) - `recoverAndLogPanic()` prevents full server crash but silently drops the close operation ### Fix Replace `tunnel.SessionID` with `rtunnel.SessionID` on both lines: ```diff - if rtunnel != nil && session.ID == tunnel.SessionID { + if rtunnel != nil && session.ID == rtunnel.SessionID { rtunnel.Close() rtunnels.RemoveRTunnel(rtunnel.ID) - } else if rtunnel != nil && session.ID != tunnel.SessionID { + } else if rtunnel != nil && session.ID != rtunnel.SessionID { ```

GHSA-c279-989m-238f Affected Sliver Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/bishopfox/sliver
Go
≤ 1.7.3

References

Frequently Asked Questions

What is GHSA-c279-989m-238f?
GHSA-c279-989m-238f is a security vulnerability in Sliver involving Nil Pointer Dereference in tunnelCloseHandler causes panic when a reverse tunnel (rportfwd) close is attempted under CWE-476: NULL Pointer Dereference.
Which Sliver versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/bishopfox/sliver.
What version fixes GHSA-c279-989m-238f?
Upgrading to current release patches (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 Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-c279-989m-238f?
GHSA-c279-989m-238f is classified under CWE-476: NULL Pointer Dereference (The product dereferences a pointer that it expects to be valid but is NULL.).
How can I check Go dependencies for GHSA-c279-989m-238f?
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-c279-989m-238f",
  "modified" : "2026-03-29T15:25:42Z",
  "published" : "2026-03-29T15:25:42Z",
  "aliases" : [ ],
  "summary" : "Sliver: Nil Pointer Dereference in tunnelCloseHandler causes panic when a reverse tunnel (rportfwd) close is attempted",
  "details" : "### Summary\nA nil pointer dereference in `tunnelCloseHandler` causes the handler goroutine to panic whenever a reverse tunnel (rportfwd) close is attempted. Both the legitimate close path AND the unauthorized close path dereference `tunnel.SessionID` where `tunnel` is guaranteed nil. This means rportfwd tunnels can never be cleanly closed, and any authenticated implant can trigger repeated goroutine panics.\n\n### Details\nFile: `server/handlers/sessions.go` lines 172 and 175\n\nThe function enters an `else` block precisely because `core.Tunnels.Get(tunnelData.TunnelID)` returned `nil`. Both conditions inside that else block then dereference `tunnel.SessionID` instead of `rtunnel.SessionID`:\n```go\n} else {\n    rtunnel := rtunnels.GetRTunnel(tunnelData.TunnelID)\n\n    if rtunnel != nil && session.ID == tunnel.SessionID {      // LINE 172 — nil deref\n        rtunnel.Close()\n        rtunnels.RemoveRTunnel(rtunnel.ID)\n    } else if rtunnel != nil && session.ID != tunnel.SessionID { // LINE 175 — nil deref\n        sessionHandlerLog.Warnf(\"...\")\n    }\n}\n```\n\nNote: The identical bug was already fixed in `tunnelDataHandler` at lines 124/126 (correctly uses `rtunnel.SessionID`), but the fix was \nnot applied to `tunnelCloseHandler`.\n\n### PoC\n```go\ntunnel := GetTunnel(999)   // returns nil — no normal tunnel with this ID\n// tunnel is nil here\n\nrtunnel := GetRTunnel(999) // returns valid rtunnel owned by session-AAAA\n\n// Both lines below panic with:\n// runtime error: invalid memory address or nil pointer dereference\nif rtunnel != nil && sessionID == tunnel.SessionID { ... }      // line 172\n} else if rtunnel != nil && sessionID != tunnel.SessionID { ... } // line 175\n```\n\nConfirmed on master commit `7ac4db3fa` with standalone reproducer.\nOutput:\n```\nPANIC on line 172 (legitimate close): runtime error: invalid memory address or nil pointer dereference\nPANIC on line 175 (unauthorized close): runtime error: invalid memory address or nil pointer dereference\n```\n\n![1](https://github.com/user-attachments/assets/93b24286-3282-454f-80a4-b01abe4f1d63)\n![2](https://github.com/user-attachments/assets/d4219aea-eb18-474c-b69a-a5e20e97161f)\n![3](https://github.com/user-attachments/assets/5a76b0d7-ae5b-4d91-bfe9-730d3e5c322c)\n\n### Impact\n- rportfwd tunnels **cannot be closed** — functional regression\n- Any authenticated implant can trigger repeated handler goroutine panics\n- rtunnel map entries leak (never cleaned up on close failure)\n- `recoverAndLogPanic()` prevents full server crash but silently drops the close operation\n\n### Fix\nReplace `tunnel.SessionID` with `rtunnel.SessionID` on both lines:\n```diff\n-  if rtunnel != nil && session.ID == tunnel.SessionID {\n+  if rtunnel != nil && session.ID == rtunnel.SessionID {\n       rtunnel.Close()\n       rtunnels.RemoveRTunnel(rtunnel.ID)\n-  } else if rtunnel != nil && session.ID != tunnel.SessionID {\n+  } else if rtunnel != nil && session.ID != rtunnel.SessionID {\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/bishopfox/sliver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.7.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/BishopFox/sliver/security/advisories/GHSA-c279-989m-238f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BishopFox/sliver"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-29T15:25:42Z",
    "nvd_published_at" : null
  }
}