A newly released working exploit for AnyPwn, a pre-authentication heap buffer overflow in AnyDesk Linux 8.0.2 that enables remote command execution before desktop-control approval.
Because the Linux service normally runs as root, successful exploitation gives attackers privileged execution without credentials or user interaction. AnyDesk fixed the vulnerability in version 8.0.3.
Rick de Jager of the V12 security team discovered the flaw using V12. The published proof of concept targets direct connections over TCP port 7070 on Linux x86_64 systems running AnyDesk in service mode.
Critical AnyDesk Linux Flaw
Its offsets are specific to the tested 8.0.2 binary, meaning other builds require adaptation rather than automatically supporting the same exploit.
The vulnerability resides in the session protocol’s mode-5 stream packet handler. This handler trusts a remotely supplied payload length before checking whether that length fits within the remaining frame.
It then adds a 16-byte object header using 32-bit arithmetic, creating an integer-overflow condition that undermines memory allocation. When the declared length is 0xfffffff0, adding 0x10 produces 0x100000000, which wraps to zero when represented as a 32-bit value.
Declared lengths through 0xffffffff consequently produce allocations of only zero to 15 bytes. However, the object retains its original large logical length, and its data pointer remains positioned beyond the undersized allocation.
Subsequent copying writes attacker-controlled packet contents outside the allocated buffer. Attackers do not need to transmit gigabytes of data: a small outer frame carries the malicious length and enough body bytes to corrupt neighboring heap objects.
This mismatch between allocated capacity and retained length supplies the exploit’s memory-corruption primitive. The exploit prepares heap memory with persistent mode-5 objects spanning multiple allocation sizes, then opens additional client connections to place potential victim objects nearby.
A crafted overflow modifies dispatch-related fields in an adjacent victim, including control data used to redirect execution through a stack pivot. A separate spray places repeated return-oriented programming chains in memory.
These objects include broad return-gadget landing regions, improving the chances that redirected execution reaches the intended chain. The chain ultimately invokes the target binary’s system() entry with an attacker-selected command.
Exploitation remains probabilistic: unfavorable heap placement can crash the service instead. Researchers also validated reachability of the vulnerable protocol path through AnyDesk relay connections using a minimal Frida trigger.
However, the released exploit demonstrates complete command execution only through direct TCP connections; relay-path reachability should not be confused with demonstrated relay-based exploitation.
Administrators should upgrade affected Linux installations to version 8.0.3 or later. Restricting untrusted access to TCP port 7070 can reduce direct exposure while patching proceeds, but it should not replace prompt patching of vulnerable services.
Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team