GHSA-c279-989m-238f: Sliver: Nil Pointer Dereference in tunnelCloseHandler causes panic when a reverse tunnel (rportfwd) close is attempted
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.
Published Mar 29, 2026
Affected packages
github.com/bishopfox/sliver
- Ecosystem
- Go
- Affected
- <= 1.7.3
- Fixed in
- No patched version yet
- Check
go list -m github.com/bishopfox/sliver
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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:
} 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
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 175Confirmed 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 dereference1 2 3
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:
- 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 {Credited to VarshankNaik.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-34227
Sliver One-Click Remote Access: Insecure CORS & Unauthenticated MCP Interface
medium5.9Mar 31, 2026CVE-2026-32941
Sliver Vulnerable to Authenticated OOM via Memory Exhaustion in mTLS/WireGuard Transports
medium5.7No fixMar 17, 2026CVE-2026-29781
Sliver is Vulnerable to Authenticated Nil-Pointer Dereference through its Handlers
low2.1No fixMar 5, 2026CVE-2026-25791
Sliver has DNS C2 OTP Bypass that Allows Unauthenticated Session Flooding and Denial of Service
high7.5Feb 6, 2026CVE-2026-25760
Sliver Vulnerable to Website Path Traversal / Arbitrary File Read (Authenticated)
medium6.5Feb 5, 2026GHSA-hjr9-wj7v-7hv8
Sliver Vulnerable to Pre-Auth Memory Exhaustion via NoEncoder Bypass
medium5.5No fixJan 5, 2026
