Skip to content

Fix out-of-bounds read in reject_contain, then drop redundant work in the rule engine - #4759

Open
matrix wants to merge 3 commits into
hashcat:masterfrom
matrix:update_rule_engine_v1
Open

Fix out-of-bounds read in reject_contain, then drop redundant work in the rule engine#4759
matrix wants to merge 3 commits into
hashcat:masterfrom
matrix:update_rule_engine_v1

Conversation

@matrix

@matrix matrix commented Aug 6, 2026

Copy link
Copy Markdown
Member
  • reject_contain used strchr on "out", which is not a NUL terminated string but out_len bytes. A candidate containing 0x00 ended the search early, so the rules "!" and "/" rejected candidates that did contain the character and the scan runs past the end of the buffer whenever no zero byte happens to follow. memchr with out_len fixes both.

  • drops work the rule engine did not need: a heap allocation per call, and two buffer clears whose bytes are never read

@matrix
matrix force-pushed the update_rule_engine_v1 branch from 667b13a to 06e88ae Compare August 6, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant