CVE-2026-68766: Argument Injection in Hashcat Restore Files
Hashcat is vulnerable to argument injection when parsing restore files, potentially leading to arbitrary code execution if a user restores a malicious session file.
CVE search metadata
CVE search record: CVE-2026-68766. Severity: high. CVSS: 7.8. KEV: no. Product: hashcat. Brief: CVE-2026-68766: Argument Injection in Hashcat Restore Files. Brief link: https://feed.craftedsignal.io/briefs/2026-08-hashcat-restore-injection/
Hashcat versions up to and including 7.1.2 are susceptible to an argument injection vulnerability (CVE-2026-68766) occurring during the parsing of restore files. This flaw allows an attacker to inject arbitrary command-line options, such as --outfile or --potfile-path, by crafting a malicious restore file. When a user runs hashcat with this file, the application processes these injected options without sufficient validation. An attacker can leverage this to redirect hashcat output to arbitrary locations on the filesystem. By targeting shell startup files (such as .bashrc, .profile, or .zshrc), an attacker can append malicious commands to these files, leading to arbitrary code execution when the victim next opens a shell. This vulnerability relies on the user performing a restore action, making it a viable target for local attackers or those capable of dropping files in directories where a user typically runs password recovery operations.
Attack Chain
- Attacker creates a malicious session restore file with injected command-line arguments (e.g., --outfile).
- Attacker places the crafted restore file in a directory monitored or used by a target user for hashcat sessions.
- Victim executes hashcat, pointing to the malicious restore file (e.g., hashcat --restore session.restore).
- Hashcat process parses the restore file and executes with the injected flags applied to its internal state.
- Hashcat writes its output or potfile data to the path specified by the attacker (e.g., ~/.bashrc).
- The injected payload is successfully appended to the target shell configuration file.
- Victim starts a new shell session, triggering the execution of the appended commands.
- Attacker-controlled code runs within the context of the user, achieving full arbitrary code execution.
Impact
Successful exploitation results in arbitrary code execution within the security context of the victim user. This could lead to full system compromise, data theft, or persistence on the host. The vulnerability affects all platforms (Windows, Linux, macOS) where hashcat 7.1.2 or earlier is deployed.
Recommendation
- Upgrade to the latest version of hashcat (post-7.1.2) where the parsing logic for restore files has been restricted.
- Audit hashcat session directories for unexpected restore file modifications, particularly in shared compute environments.
- Monitor for processes spawning with unexpected command-line arguments derived from file inputs.
- Deploy the Sigma rules below to detect suspicious hashcat command-line invocation patterns.
Immediate actions
Patch hashcat instances to version > 7.1.2.
Threat Hunt
Search for shell configuration files (e.g., .bashrc, .zshrc) recently modified by hashcat binaries.
Data: File integrity monitoring logs
Mitigations
Upgrade hashcat.
CVE-2026-68766
Detection coverage 1
Detect Potential Hashcat Argument Injection
mediumDetects hashcat being invoked with output redirection flags that correlate with the CVE-2026-68766 argument injection vulnerability.
Detection queries are available on the platform. Get full rules →