[GH-ISSUE #2244] ASan error in wbb3 with fuzzed input #1500

Closed
opened 2026-10-15 04:18:53 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @frank-dittrich on GitHub (Aug 29, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2244

Originally assigned to: @frank-dittrich on GitHub.

(bleeding-jumbo)run $ cat fail_wbb3.pw 
$wbb3$*1*0b053db000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007dc02bc6f6e24e00462f17e3c550afa9*e2063f7c629d852302d3020599376016ff340399
(bleeding-jumbo)run $ ./john fail_wbb3.pw 
=================================================================
==31205==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f597d0 at pc 0x7f4a4203f987 bp 0x7ffcd5355290 sp 0x7ffcd5354a38
WRITE of size 141 at 0x000000f597d0 thread T0
    #0 0x7f4a4203f986 in strcpy (/lib64/libasan.so.3+0x91986)
    #1 0x75e5fc in get_salt /home/fd/git/JtR/src/wbb3_fmt_plug.c:161
    #2 0x7a1262 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #3 0x7a23a0 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a57ec in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x7986e3 in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x799f0b in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79bdc1 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f4a40522730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405e38 in _start (/home/fd/git/JtR/run/john+0x405e38)

0x000000f597d0 is located 48 bytes to the left of global variable 'cur_salt' defined in 'wbb3_fmt_plug.c:80:4' (0xf59800) of size 8
0x000000f597d0 is located 0 bytes to the right of global variable 'cs' defined in 'wbb3_fmt_plug.c:151:28' (0xf597a0) of size 48
SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x91986) in strcpy
Shadow bytes around the buggy address:
  0x0000801e32a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801e32b0: 00 00 00 00 00 00 00 04 f9 f9 f9 f9 00 f9 f9 f9
  0x0000801e32c0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0000801e32d0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x0000801e32e0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 f9
=>0x0000801e32f0: f9 f9 f9 f9 00 00 00 00 00 00[f9]f9 f9 f9 f9 f9
  0x0000801e3300: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0000801e3310: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e3320: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801e3330: 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9
  0x0000801e3340: 00 00 00 00 00 00 00 00 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
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==31205==ABORTING
Originally created by @frank-dittrich on GitHub (Aug 29, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2244 Originally assigned to: @frank-dittrich on GitHub. ``` (bleeding-jumbo)run $ cat fail_wbb3.pw $wbb3$*1*0b053db000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007dc02bc6f6e24e00462f17e3c550afa9*e2063f7c629d852302d3020599376016ff340399 (bleeding-jumbo)run $ ./john fail_wbb3.pw ================================================================= ==31205==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f597d0 at pc 0x7f4a4203f987 bp 0x7ffcd5355290 sp 0x7ffcd5354a38 WRITE of size 141 at 0x000000f597d0 thread T0 #0 0x7f4a4203f986 in strcpy (/lib64/libasan.so.3+0x91986) #1 0x75e5fc in get_salt /home/fd/git/JtR/src/wbb3_fmt_plug.c:161 #2 0x7a1262 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #3 0x7a23a0 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a57ec in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x7986e3 in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x799f0b in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79bdc1 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f4a40522730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405e38 in _start (/home/fd/git/JtR/run/john+0x405e38) 0x000000f597d0 is located 48 bytes to the left of global variable 'cur_salt' defined in 'wbb3_fmt_plug.c:80:4' (0xf59800) of size 8 0x000000f597d0 is located 0 bytes to the right of global variable 'cs' defined in 'wbb3_fmt_plug.c:151:28' (0xf597a0) of size 48 SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x91986) in strcpy Shadow bytes around the buggy address: 0x0000801e32a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801e32b0: 00 00 00 00 00 00 00 04 f9 f9 f9 f9 00 f9 f9 f9 0x0000801e32c0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 0x0000801e32d0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 0x0000801e32e0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 f9 =>0x0000801e32f0: f9 f9 f9 f9 00 00 00 00 00 00[f9]f9 f9 f9 f9 f9 0x0000801e3300: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0000801e3310: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e3320: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801e3330: 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x0000801e3340: 00 00 00 00 00 00 00 00 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 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==31205==ABORTING ```
Author
Owner

@jfoug commented on GitHub (Aug 29, 2016):

44118c9

This one would cause a core, if not checked for ASAN error. Significant memory overwrite bug.

<!-- gh-comment-id:243165576 --> @jfoug commented on GitHub (Aug 29, 2016): 44118c9 This one would cause a core, if not checked for ASAN error. Significant memory overwrite bug.
Author
Owner

@jfoug commented on GitHub (Aug 29, 2016):

c1c9a6a

The prior was not quite right. wbb3 'validates' the salt as lc hex, BUT never decodes the hex. So the check for 2x max len was wrong. Also, I use ishexlcoddok since nothing stipulates that an odd value is wrong.

<!-- gh-comment-id:243170783 --> @jfoug commented on GitHub (Aug 29, 2016): c1c9a6a The prior was not quite right. wbb3 'validates' the salt as lc hex, BUT never decodes the hex. So the check for 2x max len was wrong. Also, I use ishexlcoddok since nothing stipulates that an odd value is wrong.
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#1500
No description provided.