Hashcat Stack-Based Buffer Overflow Vulnerability in Rule Engine Allowing Denial-of-Service and Potential Arbitrary Code Execution

Vulnerability

A stack-based buffer overflow vulnerability has been identified in Hashcat version 7.1.2, specifically within the rule engine's 'mangle_to_hex_lower()' and 'mangle_to_hex_upper()' functions. This vulnerability allows an attacker to cause a denial-of-service or possibly execute arbitrary code by using a crafted rule file or through the '-j' or '-k' rule options with password candidates of 128 or more characters. The issue arises from a bounds check that fails to consider the twofold expansion that occurs when password bytes are converted to hexadecimal, leading to a buffer overflow on the stack.

Impact

Exploitation of this vulnerability reliably crashes the application. While the overflow could potentially be exploited for arbitrary code execution, this has not been achieved in practice on a default build of Hashcat, which includes stack protection that would need to be bypassed first.

Reproduction

The vulnerability can be reproduced by running Hashcat with the '-j h' or '-j H' options, using a wordlist that includes password entries of 128 characters or more. The crafted rule file or rule options trigger the buffer overflow by exploiting the hexadecimal conversion process, which doubles the length of the input and exceeds the buffer's capacity.

Remediation

A pull request addressing this vulnerability has been submitted and is currently open, but not yet merged.

Added: May 1, 2026, 2:21 PM
Updated: May 1, 2026, 2:21 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
4.0
remediation
0.0
relevance
6.8
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.