mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2237] ASAN error in whirlpool formats #1494
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1494
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Aug 25, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2237
Same problem with
--format=whirlpool0and--format=whirlpool1.@jfoug commented on GitHub (Aug 25, 2016):
Please simply add formats which have this problem (--skip-self-test) when run against a ton of random crap. I figure there will be numerous formats. No need to have 20 issues for the same thing.
@frank-dittrich commented on GitHub (Aug 25, 2016):
@jfoug actually I think these were the only formats except the oracle9i format (now renamed), at least when tested against all the other jtrts hashes. May be more formats will come up if I really feed them "random crap".
@jfoug commented on GitHub (Aug 25, 2016):
Ok. Well, what it ended up being was the valid was made 'invalid' by a recent change (to the hexlen)
Hexlen function was converted from int to a size_t (unsigned). This was for longer hashes (that may be over 2gb). But in doing so, a 'special' return was removed. That return was -length IF the string was not pure. Now the return is simply the length seen, without the negative. So in this case, hexlen != PT_LEN was not failing any more. So a line with a 128 byte raw hex value, followed by crap would trigger the buffer overflow in split, since there was no null byte.
We should audit the other valid() functions, and see if usage like this is in other places. It would be the 'last' element in the hash usually.
@frank-dittrich commented on GitHub (Aug 25, 2016):
I assume hexlenl() and hexlenu() may cause the same problem now.
@jfoug commented on GitHub (Aug 25, 2016):
that is a correct assumption.
@frank-dittrich commented on GitHub (Aug 25, 2016):
@jfoug your latest commit fixes the whirlpool issue.
Should we keep this issue open for the review of hexlen() / hexlenu() / hexlenl() usage in valid?
Or should that be a new issue?
@jfoug commented on GitHub (Aug 25, 2016):
Why not rename it. We have the discussion started here.
@jfoug commented on GitHub (Aug 26, 2016):
I think the only way to fix this properly, is to again make hexlen() hexlenu() and hexlenl() return information (optionally) about whether the hex length was 'solid' (i.e. the length of the hex is the same length as the string). I will add an int pointer param. If that is not set to NULL, then on return, that int will be set to 0 or 1, depending upon full or partial length. Full will set 0, partial will set 1. It is the same 1 bit of information we were returning as a negative number.
@jfoug commented on GitHub (Aug 26, 2016):
dace1b3@jfoug commented on GitHub (Aug 26, 2016):
Any errors or crashes or asan's opened up due to change in the hexlen?() returning size_t should be corrected in the
dace1b3commit. I did not check that each location required knowledge of being 'solid' or not, but every one (in valid or prepare) that 'could' check that the hex was solid, now does, and fails if not solid. There were a few locations which could not check, because it was 2 pointers walking the hash, vs chopping up a temp allocated var. But with this new variable, all needed checks should now only allow proper hex parts of the hash to pass.