Summary
Sliver's DNS C2 listener previously accepted unauthenticated TOTP bootstrap messages and created server-side DNS sessions without validating one-time password values, even when OTP enforcement was configured.
A remote attacker could repeatedly create bogus sessions that are never cleaned up, driving unbounded memory growth and potentially causing denial of service on the Sliver server.
Affected context
This vulnerability affects Sliver command and control deployments using the DNS C2 listener with TOTP-based bootstrap and EnforceOTP enabled.
In this configuration, the server is expected to verify OTP tokens before allocating resources for new sessions.
However, in affected versions, the DNS C2 listener would accept bootstrap messages without validating the OTP and would create in-memory DNS sessions for each attempt, with no expiry or cleanup in this specific code path.
Environments exposing the DNS C2 endpoint to untrusted or internet-facing networks are most at risk.
Exploit preconditions
- Attack surface: Network-exposed DNS C2 listener endpoint.
- Required access: Remote network access capable of reaching the DNS C2 listener; no prior authentication or valid OTP is required.
- Trigger point: Sending repeated TOTP bootstrap messages to the DNS C2 listener, which are processed as if valid.
- Why exploitation is possible:
- The listener allocates server-side DNS session structures on receipt of bootstrap messages.
- OTP values are not validated in this path, even when EnforceOTP is enabled.
- Allocated sessions lack an expiry/cleanup mechanism for this flow, allowing unbounded accumulation in memory.
Why this happens
The issue stems from a combination of improper authentication enforcement and unbounded resource allocation.
Conceptually, the DNS C2 listener contains a code path where TOTP-based bootstrap messages are treated as trusted without verifying the OTP value against an expected secret, mapping to CWE-306: Missing Authentication for Critical Function.
Once accepted, the server allocates in-memory DNS session objects but does not attach them to a lifecycle that includes expiry, garbage collection, or quota enforcement in this specific flow.
This leads to CWE-400: Uncontrolled Resource Consumption, as an attacker can trigger repeated allocations of session state without corresponding release or limits.
Potential impact
- The Sliver server process may consume excessive memory, impacting overall system performance.
- The host running Sliver could experience resource starvation, affecting other services.
- The Sliver C2 functionality can be degraded or become unavailable, effectively causing a denial of service.
- In extreme cases, the operating system may terminate the process or become unstable due to memory pressure.
General mitigation guidance
Mitigation generally focuses on enforcing authentication checks before resource allocation and introducing strong resource lifecycle controls.
Common defensive patterns include:
- Ensuring OTP / authentication validation occurs before any long-lived session or object allocation, especially in bootstrap or handshake paths.
- Implementing session lifecycle management with explicit expiry, idle timeouts, and cleanup for all code paths that create server-side session objects.
- Adding per-source and global rate limiting or quotas for bootstrap and session-creation requests to bound memory growth.
- Designing listeners to fail closed when security features such as EnforceOTP are configured, so misconfigurations or incomplete implementations do not default to permissive behavior.
- Applying general hardening such as process-level memory limits and monitoring to detect abnormal resource consumption early.
How teams detect issues like this
Effective detection typically combines runtime monitoring with code-centric analysis:
- Static analysis and code review:
- Look for code paths that perform session creation or allocate persistent state before completing authentication or OTP checks.
- Identify session or connection tracking structures that lack expiry, reference counting, or cleanup logic.
- Flag conditional security features (like EnforceOTP) where the enforcement logic is not consistently applied across all entry points.
- Runtime monitoring:
- Track the number of active DNS C2 sessions and overall memory usage of the Sliver process over time.
- Set alerts on anomalous spikes in bootstrap attempts or session counts from the same or diverse IPs.
- Automated policy enforcement:
- Use CI/CD checks or automated review tools to enforce patterns such as "no resource allocation before auth" and "all session containers must have timeouts and eviction policies."

