[GH-ISSUE #1162] --prince-loopback: asan error #728

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/1162

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  --rules=SINGLE  --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

==114284==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000903ee6 at pc 0x76bded bp 0x7ffccb5dc610 sp 0x7ffccb5dc608
READ of size 1 at 0x000000903ee6 thread T0
#0 0x76bdec in rules_apply /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/rules.c:2007
#1 0x797952 in do_prince_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:2185
#2 0x73f854 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1393
#3 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687
#4 0x7f75fd328ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#5 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2)

0x000000903ee6 is located 4 bytes to the right of global variable '.LC11' from 'pp.c' (0x903ee0) of size 2
' '
.LC11' is ascii string '
0x000000903ee6 is located 58 bytes to the left of global variable '.LC13' from 'pp.c' (0x903f20) of size 42
'
.LC13' is ascii string 'Proceeding with PRINCE (int128 version)%s'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/rules.c:2007 rules_apply
Shadow bytes around the buggy address:
0x000080118780: f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 00 00 00 00
0x000080118790: 00 00 00 00 00 00 00 00 06 f9 f9 f9 f9 f9 f9 f9
0x0000801187a0: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 05 f9 f9 f9
0x0000801187b0: f9 f9 f9 f9 00 00 02 f9 f9 f9 f9 f9 01 f9 f9 f9
0x0000801187c0: f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9 00 02 f9 f9
=>0x0000801187d0: f9 f9 f9 f9 00 01 f9 f9 f9 f9 f9 f9[02]f9 f9 f9
0x0000801187e0: f9 f9 f9 f9 00 00 00 00 00 02 f9 f9 f9 f9 f9 f9
0x0000801187f0: 00 00 00 00 00 00 00 03 f9 f9 f9 f9 00 00 00 00
0x000080118800: 00 00 00 00 00 00 00 07 f9 f9 f9 f9 03 f9 f9 f9
0x000080118810: f9 f9 f9 f9 00 00 00 07 f9 f9 f9 f9 00 01 f9 f9
0x000080118820: f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==114284==ABORTING
Aborted

Originally created by @loverszhaokai on GitHub (Mar 27, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1162 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 --rules=SINGLE --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 ==114284==**ERROR**: AddressSanitizer: global-buffer-overflow on address 0x000000903ee6 at pc 0x76bded bp 0x7ffccb5dc610 sp 0x7ffccb5dc608 READ of size 1 at 0x000000903ee6 thread T0 #0 0x76bdec in rules_apply /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/rules.c:2007 #1 0x797952 in do_prince_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/pp.c:2185 #2 0x73f854 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1393 #3 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687 #4 0x7f75fd328ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #5 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2) 0x000000903ee6 is located 4 bytes to the right of global variable '_.LC11' from 'pp.c' (0x903ee0) of size 2 ' '_.LC11' is ascii string ' 0x000000903ee6 is located 58 bytes to the left of global variable '_.LC13' from 'pp.c' (0x903f20) of size 42 '_.LC13' is ascii string 'Proceeding with PRINCE (int128 version)%s' SUMMARY: AddressSanitizer: global-buffer-overflow /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/rules.c:2007 rules_apply Shadow bytes around the buggy address: 0x000080118780: f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080118790: 00 00 00 00 00 00 00 00 06 f9 f9 f9 f9 f9 f9 f9 0x0000801187a0: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 05 f9 f9 f9 0x0000801187b0: f9 f9 f9 f9 00 00 02 f9 f9 f9 f9 f9 01 f9 f9 f9 0x0000801187c0: f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9 00 02 f9 f9 =>0x0000801187d0: f9 f9 f9 f9 00 01 f9 f9 f9 f9 f9 f9[02]f9 f9 f9 0x0000801187e0: f9 f9 f9 f9 00 00 00 00 00 02 f9 f9 f9 f9 f9 f9 0x0000801187f0: 00 00 00 00 00 00 00 03 f9 f9 f9 f9 00 00 00 00 0x000080118800: 00 00 00 00 00 00 00 07 f9 f9 f9 f9 03 f9 f9 f9 0x000080118810: f9 f9 f9 f9 00 00 00 07 f9 f9 f9 f9 00 01 f9 f9 0x000080118820: f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Contiguous container OOB:fc ASan internal: fe ==114284==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):

It's not about max-run-time, not about "Single" rules and not about loopback. This also segfaults:

../run/john test.in --prince -rules
<!-- gh-comment-id:87015583 --> @magnumripper commented on GitHub (Mar 27, 2015): It's not about max-run-time, not about "Single" rules and not about loopback. This also segfaults: ``` ../run/john test.in --prince -rules ```
Author
Owner

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

This was kind of academic, but now it's fixed.

<!-- gh-comment-id:87016681 --> @magnumripper commented on GitHub (Mar 27, 2015): This was kind of academic, but now it's fixed.
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#728
No description provided.