mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1160] asaMD5_fmt: asan error #726
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#726
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 @loverszhaokai on GitHub (Mar 26, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1160
This bug is found by fuzzzing John using AFL.
#1. Prepare
1.1 content of asaMD5_fmt
$dynamic_20$h3mJrcH0901pqX/m$alex
$dynamic_20$3USUcOPFUiMCO4Jk$cisc
$dynamic_20$lZt7HSIXw3.QP7.R$admc
$dynamic_20$hN7LzeyYjw12FSIU$john
$dynamic_20$7DrfeZ7cyOj/PslD$jack
1.2 compile with asan
$ export ASAN_OPTIONS='abort_on_error=1'
$ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure CC=gcc-4.9 --enable-asan && make -sj8
#2. Reproduce
Note: you should press Ctrl-C to abort john, and after cancel you will see the asan error
$ ./john asaMD5_fmt
Warning: detected hash type "dynamic_20", but the string is also recognized as "asa-md5"
Use the "--format=asa-md5" option to force loading these as that type instead
Loaded 5 password hashes with 5 different salts (dynamic_20 [Cisco ASA (MD5 salted) 128/128 AVX (480*1)x4x3])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
ripper (?)
Warning: MaxLen = 13 is too large for the current hash type, reduced to 12
1g 0:00:00:00 0.00% 3/3 (ETA: 21:29:46) 1.098g/s 199327p/s 804061c/s 804061C/s 013356..036666
Use the "--show" option to display all of the cracked passwords reliably
==21438==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x0000022a6080 in thread T0
#0 0x7fb3c2f465c7 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x545c7)
#1 0x7a6c62 in MEMDBG_off_free /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/memdbg.c:1099
#2 0x49137b in done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/dynamic_fmt.c:861
#3 0x732358 in fmt_done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/formats.c:112
#4 0x73fecb in john_done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/john.c:1478
#5 0x740633 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/john.c:1688
#6 0x7fb3c1785ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#7 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/run/john+0x406cb2)
AddressSanitizer can not describe address in more detail (wild memory access suspected).
SUMMARY: AddressSanitizer: bad-free ??:0 __interceptor_free
==21438==ABORTING
Aborted (core dumped)
@magnumripper commented on GitHub (Mar 26, 2015):
You list contents of aix_smd5_fmt but you run with asaMD5_fmt... which is it?
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper Thanks. It should be asaMD5_fmt. Updated.
@magnumripper commented on GitHub (Mar 26, 2015):
I can not reproduce. I suspect this too is the gcc 4.8 bug.
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper I am going to check it. Thanks.
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper gcc-4.9 can reproduce. I have updated the issue.
@magnumripper commented on GitHub (Mar 26, 2015):
OK, I still can't reproduce so I can't debug it... if you revert to
2804be376ordc6159870, can you reproduce it? I still suspect this is an ASan problem and not a bug in our code.@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper
Both
github.com/magnumripper/JohnTheRipper@2804be3762andgithub.com/magnumripper/JohnTheRipper@dc6159870ecan not reproduce. The bug seems to be introduced days ago.@magnumripper commented on GitHub (Mar 26, 2015):
Not necessarily, it might be that it was hidden before.
Try this (using latest commit again):
When I run it, same address is printed (and obviously ASan does not crash). What is the output you get, right before it crashes?
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper What's the commit of the John ?
@magnumripper commented on GitHub (Mar 26, 2015):
latest
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper
0g 0:00:00:04 3/3 0g/s 1186Kp/s 1186Kc/s 1186KC/s pr12346..plaurra
done(): crypt_key2 is at 0x2e8a080
==58621==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002e8a080 in thread T0
@magnumripper commented on GitHub (Mar 26, 2015):
OK this is clearly an ASan bug. The pointer is fine.
@magnumripper commented on GitHub (Mar 26, 2015):
Scrap that, I misread your post. You need to look at both prints. I get this:
$ ../run/john asaMD5_fmt
init(): crypt_key2 is at 0x63300001c800
Warning: detected hash type "dynamic_20", but the string is also recognized as "asa-md5"
Use the "--format=asa-md5" option to force loading these as that type instead
Loaded 5 password hashes with 5 different salts (dynamic_20 [Cisco ASA (MD5 salted) 128/128 AVX (480x1)x4x3])
Remaining 1 password hash
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Warning: MaxLen = 13 is too large for the current hash type, reduced to 12
0g 0:00:00:03 3/3 0g/s 108096p/s 108096c/s 108096C/s chessed..sonas13
done(): crypt_key2 is at 0x63300001c800
Session aborted
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper
init(): crypt_key2 is at 0x2e8a080
Warning: detected hash type "dynamic_20", but the string is also recognized as "asa-md5"
Use the "--format=asa-md5" option to force loading these as that type instead
Loaded 5 password hashes with 5 different salts (dynamic_20 [Cisco ASA (MD5 salted) 128/128 AVX (480_1)x4x3])
Remaining 1 password hash
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Warning: MaxLen = 13 is too large for the current hash type, reduced to 12
0g 0:00:00:04 3/3 0g/s 1186Kp/s 1186Kc/s 1186KC/s pr12346..plaurra
_done(): crypt_key2 is at 0x2e8a080*
==58621==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002e8a080 in thread T0
#0 0x7f95b13775c7 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x545c7)
#1 0x7a6e08 in MEMDBG_off_free /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/memdbg.c:1099
#2 0x4913be in done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/dynamic_fmt.c:863
#3 0x7323db in fmt_done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/formats.c:112
#4 0x73ff4e in john_done /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/john.c:1478
#5 0x7406b6 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/src/john.c:1688
#6 0x7f95afbb6ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#7 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_valid/run/john+0x406cb2)
AddressSanitizer can not describe address in more detail (wild memory access suspected).
SUMMARY: AddressSanitizer: bad-free ??:0 __interceptor_free
==58621==ABORTING
Aborted
@magnumripper commented on GitHub (Mar 26, 2015):
If you get same address printed from init() and done(), you probably just see an ASan bug. You can verify this by running a build without ASan - it should definitely segfault if there was an actual problem.
@loverszhaokai commented on GitHub (Mar 26, 2015):
@magnumripper Thanks. 👍