Back to Intelligence

CVE-2026-76840: RustDesk Windows Clipboard Redirection Heap Overflow (CVSS 9.6) — Detection, Hunting, and Remediation Guide

SA
Security Arsenal Team
August 24, 2026
10 min read

The NVD has published CVE-2026-76840, a CVSS 9.6 (CRITICAL), network-exploitable vulnerability in RustDesk's Windows clipboard redirection (cliprdr) implementation. RustDesk is one of the most widely deployed open-source remote desktop tools in enterprise and SMB environments — and, candidly, one of the most abused legitimate RMM tools by threat actors. This flaw makes the situation materially worse: a malicious or compromised remote peer (including a rogue relay/ID server) can trigger a heap-based buffer overflow in the client-side process handling OLE paste operations, simply by sending a crafted CLIPRDR FileContentsResponse with an attacker-controlled length field.

The practical risk model here is inverted from what most defenders assume. We normally worry about what a RustDesk session lets an attacker do interactively. CVE-2026-76840 means the attacker never needs interactive control at all — they only need the victim to connect to (or be connected from) a hostile endpoint and perform a clipboard paste involving a file consumer such as explorer.exe. For organizations that permit RustDesk on endpoints, this is a patch-and-verify event, not a monitor-and-wait event.

Technical Analysis

Affected Component

  • Product: RustDesk (Windows client)
  • Affected code: libs/clipboard/src/windows/wf_cliprdr.c — specifically CliprdrStream_Read, cliprdr_send_request_filecontents, and wf_cliprdr_server_file_contents_response
  • Platform: Windows hosts running the RustDesk client with clipboard redirection enabled (the default in most deployments)
  • CVE: CVE-2026-76840 — CVSS 3.1 9.6 (CRITICAL), attack vector NETWORK
  • Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-76840

Root Cause — Defender's View of the Bug

The vulnerability is a textbook missing upper-bound check on a peer-supplied length flowing into a fixed-size caller buffer:

  1. When a user pastes clipboard contents into an OLE paste consumer (e.g., explorer.exe during a file paste), the consumer calls IStream::Read with a buffer of cb bytes.
  2. CliprdrStream_Read in wf_cliprdr.c requests that many bytes of the remote file from the peer via cliprdr_send_request_filecontents.
  3. The peer responds with a CLIPRDR FileContentsResponse. The handler wf_cliprdr_server_file_contents_response copies the response's declared size verbatim into clipboard->req_fsize — with no validation against the size of the destination buffer.
  4. CliprdrStream_Read then executes CopyMemory(pv, clipboard->req_fdata, clipboard->req_fsize), copying req_fsize bytes into a caller buffer sized only for cb bytes.

If the peer lies and declares req_fsize > cb, the result is a controlled-length heap buffer overflow in the process hosting the clipboard stream. The attacker controls both the overflow length and the overflow content (the file contents they serve). That is the primitive class that leads to remote code execution with careful heap grooming — and at minimum, reliable process crashes (denial of service) in the client session host or paste consumer.

Exploitation Requirements

  • The victim must be running a vulnerable RustDesk Windows client.
  • The attacker must be on the other end of the RustDesk session — as the remote peer, or by operating/redirecting traffic through a malicious RustDesk ID/relay server (self-hosted relays are common, which widens the trust surface considerably).
  • The victim (or an application on the victim's behalf) must initiate a clipboard paste that triggers IStream::Read on a redirected file stream — a routine action like pasting a copied file into Explorer.

Exploitation Status

As of publication, CVE-2026-76840 is newly disclosed via NVD. There is no confirmed CISA KEV listing at time of writing, but given RustDesk's documented popularity with initial-access brokers and ransomware affiliates as an RMM of choice, defenders should treat weaponization as a near-term certainty rather than a hypothetical. Patch verification should be completed before public proof-of-concept code matures.

Detection & Response

Detection of the overflow itself at the moment of exploitation is difficult — it happens inside legitimate process memory during a legitimate clipboard operation. The defensible strategy is three-pronged: (1) inventory and control where RustDesk exists and who it talks to, (2) detect crash artifacts consistent with heap corruption in RustDesk-adjacent processes, and (3) detect post-exploitation behavior (unexpected child processes, payload staging) following a session.

Sigma Rules

YAML
---
title: RustDesk Session Followed by Suspicious Child Process Execution
id: 3f8a1c92-7b4d-4e6a-9f21-5c8d2e1a6b70
status: experimental
description: Detects rustdesk.exe spawning command interpreters, scripting engines, or LOLBins, which may indicate post-exploitation activity following clipboard redirection abuse such as CVE-2026-76840.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-76840
  - https://attack.mitre.org/techniques/T1219/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.command_and_control
  - attack.t1219
  - attack.execution
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith: '\rustdesk.exe'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\mshta.exe'
      - '\rundll32.exe'
      - '\regsvr32.exe'
  condition: selection_parent and selection_child
falsepositives:
  - Administrator-initiated remote support sessions where the technician opens a shell on the endpoint
level: high
---
title: Application Crash of RustDesk or Explorer During Remote Session
id: 9c2d4e61-3a7f-4b58-8d10-6e9f1a2c5b84
status: experimental
description: Detects Windows Error Reporting (WerFault) invocation for rustdesk.exe or explorer.exe, a potential indicator of heap corruption from a malformed CLIPRDR FileContentsResponse (CVE-2026-76840).
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-76840
  - https://attack.mitre.org/techniques/T1219/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.command_and_control
  - attack.t1219
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith: '\WerFault.exe'
    CommandLine|contains:
      - 'rustdesk.exe'
      - 'explorer.exe'
  condition: selection
falsepositives:
  - Ordinary application instability; correlate with active RustDesk session telemetry before escalation
level: medium
---
title: RustDesk Client Connection to Non-Corporate Relay or ID Server
id: 5e7b3a14-2c9d-4f68-a135-8b4e6d0c9a27
status: experimental
description: Detects rustdesk.exe establishing outbound connections on default RustDesk service ports (TCP 21115-21119, UDP 21116), which may indicate use of an unauthorized or attacker-controlled relay in CVE-2026-76840 exploitation scenarios.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-76840
  - https://attack.mitre.org/techniques/T1219/
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.command_and_control
  - attack.t1219
logsource:
  category: network_connection
  product: windows
detection:
  selection_image:
    Image|endswith: '\rustdesk.exe'
  selection_port:
    DestinationPort:
      - 21115
      - 21116
      - 21117
      - 21118
      - 21119
  filter_approved:
    DestinationIp|cidr:
      - '10.0.0.0/8'
      - '192.168.0.0/16'
  condition: selection_image and selection_port and not filter_approved
falsepositives:
  - Connections to the official public RustDesk relay infrastructure; tune filter_approved to your sanctioned relay/IP ranges
level: medium

KQL — Microsoft Sentinel / Defender

KQL — Microsoft Sentinel / Defender
// Hunt: RustDesk clipboard-overflow exposure — unauthorized installs, suspicious sessions, and crash artifacts
// 1) Endpoints running RustDesk (inventory for CVE-2026-76840 exposure assessment)
DeviceProcessEvents
| where FileName =~ "rustdesk.exe" or ProcessCommandLine has "rustdesk"
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), ExecutionCount=count()
  by DeviceName, FolderPath, SHA256
| order by LastSeen desc;

// 2) RustDesk connections to non-allowlisted relays (adjust allowlist to your sanctioned ID/relay servers)
let ApprovedRelays = dynamic(["relay.yourcompany.example.com", "203.0.113.10"]);
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "rustdesk.exe"
| where RemotePort in (21115, 21116, 21117, 21118, 21119)
| where not(RemoteUrl in (ApprovedRelays) or RemoteIP in (ApprovedRelays))
| summarize Connections=count(), Ports=make_set(RemotePort), IPs=make_set(RemoteIP)
  by DeviceName, InitiatingProcessAccountName
| order by Connections desc;

// 3) Crash telemetry for rustdesk.exe / explorer.exe during or shortly after RustDesk activity (possible heap corruption)
let RustDeskDevices = DeviceProcessEvents
    | where FileName =~ "rustdesk.exe" and TimeGenerated > ago(7d)
    | summarize by DeviceName;
DeviceEvents
| where ActionType has "ExploitGuard" or FileName =~ "WerFault.exe"
| where DeviceName in (RustDeskDevices)
| project TimeGenerated, DeviceName, ActionType, FileName, ProcessCommandLine
| order by TimeGenerated desc;

// 4) Post-exploitation: LOLBin child processes spawned under rustdesk.exe
DeviceProcessEvents
| where InitiatingProcessFileName =~ "rustdesk.exe"
| where FileName in~ ("cmd.exe","powershell.exe","pwsh.exe","mshta.exe","rundll32.exe","regsvr32.exe","wscript.exe","cscript.exe")
| project TimeGenerated, DeviceName, FileName, ProcessCommandLine, AccountName, InitiatingProcessCommandLine
| order by TimeGenerated desc;

Velociraptor VQL

VQL — Velociraptor
-- CVE-2026-76840 exposure hunt: RustDesk installs, versions, and live relay connections
-- Deploy as a notebook/hunt across Windows endpoints to scope remediation priority.

SELECT
    Pid,
    Name,
    Exe,
    CommandLine,
    Username,
    CreateTime
FROM pslist()
WHERE Name =~ '(?i)rustdesk'
   OR Exe =~ '(?i)rustdesk'

-- Correlate with live outbound connections on default RustDesk service ports
SELECT
    Pid,
    Name,
    Status,
    Laddr,
    Lport,
    Raddr,
    Rport
FROM netstat()
WHERE Name =~ '(?i)rustdesk'
   OR Rport in (21115, 21116, 21117, 21118, 21119)

-- Enumerate installed RustDesk binaries for version verification against the fixed release
SELECT
    FullPath,
    Size,
    Mtime
FROM glob(globs=[
    'C:/Program Files/RustDesk/**/*.exe',
    'C:/Users/*/AppData/**/rustdesk*.exe',
    'C:/Users/*/Downloads/rustdesk*.exe'
])

Remediation & Verification Script

PowerShell
# CVE-2026-76840 - RustDesk clipboard redirection heap overflow
# Verify RustDesk presence/version, disable clipboard redirection as a workaround,
# and audit network exposure. Run elevated. Test in a pilot ring first.

$ErrorActionPreference = 'SilentlyContinue'
$report = [ordered]@{}

# --- 1. Locate RustDesk installations and capture version ---
$rustdeskPaths = @(
    "$env:ProgramFiles\RustDesk\rustdesk.exe",
    "${env:ProgramFiles(x86)}\RustDesk\rustdesk.exe"
)
$found = @()
foreach ($p in $rustdeskPaths) {
    if (Test-Path $p) { $found += $p }
}
# Catch per-user / portable installs
$found += Get-ChildItem -Path "$env:SystemDrive\Users" -Recurse -Filter 'rustdesk.exe' -ErrorAction SilentlyContinue |
          Select-Object -ExpandProperty FullName

$report.RustDeskFound = ($found.Count -gt 0)
$report.InstallPaths  = $found
$report.Versions      = $found | ForEach-Object { (Get-Item $_).VersionInfo.ProductVersion }

Write-Host "[i] RustDesk instances found: $($found.Count)"
$report.Versions | ForEach-Object { Write-Host "    Version: $_" }
Write-Host "[!] ACTION: Upgrade ALL instances to the latest RustDesk release that resolves CVE-2026-76840."
Write-Host "    Verify the fix at: https://nvd.nist.gov/vuln/detail/CVE-2026-76840 and the RustDesk GitHub security advisory."

# --- 2. WORKAROUND (pre-patch): disable clipboard redirection in RustDesk config ---
# RustDesk reads per-user config from %APPDATA%\RustDesk\config\RustDesk2.toml
$users = Get-ChildItem "$env:SystemDrive\Users" -Directory
foreach ($u in $users) {
    $cfg = Join-Path $u.FullName 'AppData\Roaming\RustDesk\config\RustDesk2.toml'
    if (Test-Path $cfg) {
        $content = Get-Content $cfg -Raw
        if ($content -match "enable-clipboard") {
            $content = $content -replace "enable-clipboard\s*=\s*'Y'", "enable-clipboard = 'N'"
            $content = $content -replace "enable-clipboard\s*=\s*'true'", "enable-clipboard = 'N'"
        } else {
            $content += "`n[options]`nenable-clipboard = 'N'`n"
        }
        Set-Content -Path $cfg -Value $content -Force
        Write-Host "[+] Clipboard redirection disabled in config: $cfg"
    }
}

# --- 3. Restrict RustDesk service ports at the host firewall until patched ---
$ruleName = 'Block-RustDesk-Relay-CVE-2026-76840'
if (-not (Get-NetFirewallRule -DisplayName $ruleName)) {
    New-NetFirewallRule -DisplayName $ruleName -Direction Outbound -Action Block `
        -RemotePort 21115,21116,21117,21118,21119 -Protocol TCP -Profile Any | Out-Null
    Write-Host '[+] Outbound block on RustDesk default service ports applied (remove after patching + approving relays).'
}

# --- 4. Audit: recent crash artifacts for rustdesk.exe / explorer.exe ---
$crashes = Get-WinEvent -FilterHashtable @{LogName='Application'; Id=1000; StartTime=(Get-Date).AddDays(-7)} |
    Where-Object { $_.Message -match 'rustdesk\.exe|explorer\.exe' }
$report.RecentCrashEvents = @($crashes).Count
Write-Host "[i] Application Error events (rustdesk/explorer, last 7 days): $($report.RecentCrashEvents)"

$report | ConvertTo-Json -Depth 4

Remediation

  1. Patch immediately. Upgrade every RustDesk Windows client to the latest release that resolves CVE-2026-76840. Confirm the fixed version via the NVD entry and the RustDesk project's security advisory/release notes on GitHub before deploying. Do not assume auto-update has fired — verify per-endpoint with the script above or your software inventory tool.
  2. Until patched, disable clipboard redirection. Set enable-clipboard = 'N' in the RustDesk configuration (and, where managed, disable file transfer as well). This removes the vulnerable cliprdr code path entirely — the overflow cannot be reached if clipboard file-contents requests are never processed.
  3. Control the trust surface. The exploit requires a hostile peer or relay. Enforce that RustDesk clients only use your approved self-hosted ID/relay servers, and block outbound access to public/unknown RustDesk infrastructure (TCP 21115–21119, UDP 21116) at the egress firewall and host firewall for everything except sanctioned relays.
  4. Inventory and govern RMM tooling broadly. If RustDesk is not an approved tool in your environment, its presence alone is an incident — unauthorized RMM remains a top initial-access vector. Use the KQL inventory query above to find installs, then remove or formally approve them.
  5. Hunt for exploitation artifacts. Review Application Error events (Event ID 1000) and WER reports for rustdesk.exe and explorer.exe crashes over the past 30 days on hosts with known RustDesk sessions to external peers. Heap-corruption crashes during active sessions warrant DFIR triage.
  6. Post-patch verification. After upgrading, confirm the deployed binary version fleet-wide, re-enable clipboard only where operationally required, and remove temporary firewall blocks only for approved relay destinations.

Bottom line: a CVSS 9.6, network-reachable, peer-triggered heap overflow in a tool that threat actors already love is a "drop-everything" patch candidate. Disable clipboard redirection today, patch fleet-wide this week, and treat any RustDesk session to an unvetted peer as hostile until proven otherwise.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.