mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1943] ASan crash in Raw-MD5 format #1296
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#1296
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 @kholia on GitHub (Dec 9, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1943
Originally assigned to: @magnumripper on GitHub.
@magnumripper commented on GitHub (Dec 9, 2015):
Must be
c899f16cd@magnumripper commented on GitHub (Dec 9, 2015):
@jfoug please tell me what I did wrong.
We checked length of fields[1] and out has sufficient size. We pass sizeof(out). As far as I can see the bug is in base64_convert?
@magnumripper commented on GitHub (Dec 9, 2015):
@kholia did you by any chance miss to
make clean? I can't reproduce.@kholia commented on GitHub (Dec 9, 2015):
Yes, I did
make cleanand I can reproduce this on my system runninggcc (Ubuntu 5.3.1-3ubuntu1) 5.3.1 20151207.I will handle this "tomorrow".
@magnumripper commented on GitHub (Dec 9, 2015):
Hmm why can I not reproduce on super then? Very very strange.
@jfoug commented on GitHub (Dec 9, 2015):
I can not reproduce either, BUT I think this is the 'classic' We need 4 extra bytes for base64 convert.
@kholia can you make this change and test?
@kholia commented on GitHub (Dec 9, 2015):
@jfoug that still results in a crash.
This works, WTF :|
@jfoug commented on GitHub (Dec 9, 2015):
CY9rzUYh03PK3k6DJie09g== requires 36 bytes (plus null)
CY9r
zUYh
03PK
3k6D
Jie0
9g==
Each of those are 6 bytes of hex output.
@kholia commented on GitHub (Dec 9, 2015):
Fixed in commit
72b3c7cadc. Thanks @jfoug 👍@magnumripper commented on GitHub (Dec 9, 2015):
OK I can see how/why this happened now. But I do not like this fix very much. We should fix the base64 conversion. Why would we supply
sizeof(out)at all, if it's blatantly ignored?@jfoug commented on GitHub (Dec 9, 2015):
The way to do this will lose performance. That is to always convert into a temp buffer, and then copy from that temp buffer into the 'final' buffer. This could be done with a 7 byte buffer (large enough for the 6 bytes + null. Then the problem goes away.
The 'bug' is due to using the output buffer to write into.
@jfoug commented on GitHub (Dec 9, 2015):
This has been a 'well known' bug. But usually it was 4 extra bytes in size, since usually we were doing base-64 into raw. That gives us 4 byte blocks into 3 bytes. For the 64-2-hex, it is 4 bytes into 6 + null, so it is 7 bytes longer (at max).
@magnumripper commented on GitHub (Dec 9, 2015):
Is base64_convert ever performance critical?
@jfoug commented on GitHub (Dec 9, 2015):
I believe it is in some formats, but I am not sure any of them are quick. Things like scrypt (IIRC) use it in the inner loop. I am not sure anything moderately fast uses it.
It does make load times longer for high count of hashes. But 'most' high count hash bundles are base-16, and thus are quick, even if the base64_convert code is used.
@magnumripper commented on GitHub (Dec 9, 2015):
I think mime_to_hex could have some added cleverness with regards to to_len. But I'm not sure we should touch it until after Jumbo-2.
OTOH I doubt a memcpy would give a measurable drop in speed. The code isn't written for speed at all.
@magnumripper commented on GitHub (Dec 9, 2015):
I'll ignore this until next time it bites me.
@jfoug commented on GitHub (Dec 9, 2015):
lol. Understood.