[GH-ISSUE #1163] --prince-loopback and --min-length: asan error #729

Closed
opened 2026-10-14 03:21:38 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @loverszhaokai on GitHub (Mar 27, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1163

This bug is found by fuzzzing John using Fuzz Options.
#1. Prepare

1.1 content of 7z_fmt

$7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b

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

$ ./john  --max-run-time=1  7z_fmt  --min-length=1111111  --prince-loopback=password.lst

Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64])
Will run 8 OpenMP threads
Note: This format may emit false positives, so it will keep trying even after
finding a possible candidate.
Press 'q' or Ctrl-C to abort, almost any other key for status
ASAN:SIGSEGV

==117718==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000791134 sp 0x7fffa070b880 bp 0x7fffa070b880 T0)
#0 0x791133 in sort_by_cnt /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:560
#1 0x7f30edde0408 (/lib/x86_64-linux-gnu/libc.so.6+0x3a408)
#2 0x7f30edde1721 in qsort_r (/lib/x86_64-linux-gnu/libc.so.6+0x3b721)
#3 0x7961d5 in do_prince_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:1882
#4 0x73f854 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1393
#5 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687
#6 0x7f30eddc7ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#7 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:560 sort_by_cnt
==117718==ABORTING
Aborted

Originally created by @loverszhaokai on GitHub (Mar 27, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1163 This bug is found by fuzzzing John using Fuzz Options. #1. Prepare ## 1.1 content of 7z_fmt ``` $7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b ``` ## 1.2 compile with asan ``` shell $ 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 ``` shell $ ./john --max-run-time=1 7z_fmt --min-length=1111111 --prince-loopback=password.lst ``` Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64]) Will run 8 OpenMP threads Note: This format may emit false positives, so it will keep trying even after finding a possible candidate. Press 'q' or Ctrl-C to abort, almost any other key for status **ASAN:SIGSEGV** ==117718==**ERROR**: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000791134 sp 0x7fffa070b880 bp 0x7fffa070b880 T0) #0 0x791133 in sort_by_cnt /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:560 #1 0x7f30edde0408 (/lib/x86_64-linux-gnu/libc.so.6+0x3a408) #2 0x7f30edde1721 in qsort_r (/lib/x86_64-linux-gnu/libc.so.6+0x3b721) #3 0x7961d5 in do_prince_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:1882 #4 0x73f854 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1393 #5 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687 #6 0x7f30eddc7ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #7 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:560 sort_by_cnt ==117718==ABORTING Aborted
bsakaguchi 2026-10-14 03:21:38 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (Mar 27, 2015):

Ooops. We do have a check for this in place, but apparently it happens later than prince init.

<!-- gh-comment-id:86998121 --> @magnumripper commented on GitHub (Mar 27, 2015): Ooops. We do have a check for this in place, but apparently it happens later than prince init.
Author
Owner

@magnumripper commented on GitHub (Mar 27, 2015):

It turns out those length checks are per mode, so we lacked them for Prince.

<!-- gh-comment-id:87014713 --> @magnumripper commented on GitHub (Mar 27, 2015): It turns out those length checks are per mode, so we lacked them for Prince.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#729
No description provided.