A single misconfigured binary can open the door. Mosh privilege escalation is one of those doors, and it can be wide open if your system isn’t locked down.
Mosh is a widely used remote terminal application, prized for its ability to maintain persistent SSH-like sessions over unstable networks. But under certain conditions, Mosh can be exploited to gain elevated privileges. When privilege escalation happens, a normal user can execute commands as root or another privileged account — bypassing the intended security boundaries.
The risk appears when Mosh is installed or configured with improper permissions. Setuid binaries, world-writable directories, or insecure PATH usage can all be triggers. Attackers exploit these misconfigurations by injecting malicious code or replacing trusted binaries, allowing them to hijack sessions or execute unauthorized commands. This is not hypothetical; privilege escalation through network tools like Mosh has been observed in real-world scenarios, often as part of a larger attack chain.