mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #894] Segfault in blackberry-es10 format #498
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#498
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 (Dec 15, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/894
On my 64bit Linux system:
This is the contents of
fail_blackberry-es10.pw:@jfoug commented on GitHub (Dec 15, 2014):
This is a bug probably in other formats.
Simple to do. @frank-dittrich if you have pre-built input files with hashes from all formats (from -list= stuff), then simply append $000000000000.....000000000000 to the end of every hash string, then test for crashes. I bet there are other formats than blackberry.
What it did was validated the format, but never validated that it was at the end of the check. Then within get_salt, it simply did a strrchr(cipher, '$'). But that '$' was to the byte right past the validation, and pushed up against that huge string. Other formats might do the same thing in binary, etc. Even if a format does not crash, if it fails to crack for what 'would' have been a valid hash, then likely it has the same bug and should be fixed.
If you find them, then append a list to this bug report and I will dig in and fix them. They are pretty easy to fix, and you can probably script finding them to get a list quickly.
@frank-dittrich commented on GitHub (Dec 15, 2014):
Not just appending digits at the end, but also at the end of individual parts of the hash (separated by '$', '#' or '*') is exactly what Alexander Cherepanov's fuzzer does, amnong other manglings:
http://thread.gmane.org/gmane.comp.security.openwall.john.devel/8105
It also uses valid hashes as input. While the original fuzzer grepped the source code, I changed it to use ./john --list=format-tests ooutput...
So I think most of the formats that were vulnerable to such manglings have been fixed meanwhile.
The only format which is harder to test with fuzzed intpu is LUKS, because valid() accepts hashes wich run into an assert() in get_salt().
@frank-dittrich commented on GitHub (Dec 15, 2014):
May be I need to test the GPU formats as well, most of the time I just test the CPU formats.
@jfoug commented on GitHub (Dec 15, 2014):
If you are happy that the fuzzer has ferreted out the problems, then I will simply close this, and when others show, fix them. As long as they properly crash in VC, it takes just a couple minutes to see what is wrong (usually something missing), and fix it.
@magnumripper commented on GitHub (Dec 15, 2014):
The GPU formats should almost always have exact copies of the CPU format's valid(), split() and prepare() (perhaps they should actually share that code in a header but that's another issue). It's very important that for each and every bug you fix in these functions, ask yourself "do we have a GPU format for this too?".
A project for J2 might be to actually move all such dupe code to shared headers.
@frank-dittrich commented on GitHub (Dec 15, 2014):
Yes, we need a code-cleanup issue for J2:
-shared code among implementations of the same format (shared valid, split, ...)
-shared helper functions (not N copies of is_hex or ishex, etc.)
@magnumripper commented on GitHub (Dec 15, 2014):
Yeah things like is_hex() should go to misc.c and things like valid() to eg. pwsafe.h or pwsafe_plug.c (depending on circumstances).