[GH-ISSUE #1553] wow_srp_fmt_plug.c:336 Asan global-buffer-overflow #1017

Closed
opened 2026-10-14 03:31:55 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @loverszhaokai on GitHub (Jul 13, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1553

#1. Reproduce

$ cat pwfile

$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073616C7432*DIZ

$ ./configure --enable-asan && make -sj8
$ ./john pwfile

=================================================================
==17460==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000121a2a1 at pc 0x901813 bp 0x7fff59da2740 sp 0x7fff59da2738
READ of size 1 at 0x00000121a2a1 thread T0
    #0 0x901812 in get_salt /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/wow_srp_fmt_plug.c:336
    #1 0x950b51 in ldr_load_pw_line /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:916
    #2 0x94b503 in read_file /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:135
    #3 0x951e4e in ldr_load_pw_file /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:1019
    #4 0x94758c in john_load /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1023
    #5 0x948ceb in john_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1307
    #6 0x94a8b3 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1748
    #7 0x7ffba67c3ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
    #8 0x406de8 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/run/john+0x406de8)

0x00000121a2a1 is located 0 bytes to the right of global variable 'ct' from 'wow_srp_fmt_plug.c' (0x121a200) of size 161
  'ct' is ascii string '$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
0x00000121a2a1 is located 63 bytes to the left of global variable 'out' from 'wow_srp_fmt_plug.c' (0x121a2e0) of size 32
SUMMARY: AddressSanitizer: global-buffer-overflow /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/wow_srp_fmt_plug.c:336 get_salt
Shadow bytes around the buggy address:
  0x00008023b400: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x00008023b410: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x00008023b420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008023b430: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x00008023b440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x00008023b450: 00 00 00 00[01]f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x00008023b460: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008023b470: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x00008023b480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008023b490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008023b4a0: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 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
==17460==ABORTING
Aborted (core dumped)

#2. gdb Debug

Program received signal SIGABRT, Aborted.
0x00007ffff5790cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5790cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff57940d8 in __GI_abort () at abort.c:89
#2  0x00007ffff6f640e9 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1
#3  0x00007ffff6f5bde5 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1
#4  0x00007ffff6f5fbe2 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1
#5  0x00007ffff6f5b279 in __asan_report_error () from /usr/lib/x86_64-linux-gnu/libasan.so.1
#6  0x00007ffff6f5c0c4 in __asan_report_load1 () from /usr/lib/x86_64-linux-gnu/libasan.so.1
#7  0x0000000000901813 in get_salt (ciphertext=0x121a200 <ct> "$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$", '0' <repeats 87 times>)
    at wow_srp_fmt_plug.c:336
#8  0x0000000000950b52 in ldr_load_pw_line (db=0x1225e80 <database>,
    line=0x7ffffffce690 "$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$", '0' <repeats 100 times>, "73616C7432*DIZ") at loader.c:916
#9  0x000000000094b504 in read_file (db=0x1225e80 <database>, name=0x631000000868 "err_pwfiles/pwfile.WoWSRP", flags=2, process_line=0x94fd2d <ldr_load_pw_line>) at loader.c:135
#10 0x0000000000951e4f in ldr_load_pw_file (db=0x1225e80 <database>, name=0x631000000868 "err_pwfiles/pwfile.WoWSRP") at loader.c:1019
#11 0x000000000094758d in john_load () at john.c:1023
#12 0x0000000000948cec in john_init (name=0x7fffffffec31 "john", argc=2, argv=0x7fffffffe998) at john.c:1307
#13 0x000000000094a8b4 in main (argc=2, argv=0x7fffffffe998) at john.c:1748
(gdb)
Originally created by @loverszhaokai on GitHub (Jul 13, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1553 #1. Reproduce $ cat pwfile ``` $WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073616C7432*DIZ ``` $ ./configure --enable-asan && make -sj8 $ ./john pwfile ``` ================================================================= ==17460==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000121a2a1 at pc 0x901813 bp 0x7fff59da2740 sp 0x7fff59da2738 READ of size 1 at 0x00000121a2a1 thread T0 #0 0x901812 in get_salt /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/wow_srp_fmt_plug.c:336 #1 0x950b51 in ldr_load_pw_line /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:916 #2 0x94b503 in read_file /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:135 #3 0x951e4e in ldr_load_pw_file /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/loader.c:1019 #4 0x94758c in john_load /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1023 #5 0x948ceb in john_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1307 #6 0x94a8b3 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/john.c:1748 #7 0x7ffba67c3ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #8 0x406de8 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/run/john+0x406de8) 0x00000121a2a1 is located 0 bytes to the right of global variable 'ct' from 'wow_srp_fmt_plug.c' (0x121a200) of size 161 'ct' is ascii string '$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' 0x00000121a2a1 is located 63 bytes to the left of global variable 'out' from 'wow_srp_fmt_plug.c' (0x121a2e0) of size 32 SUMMARY: AddressSanitizer: global-buffer-overflow /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_kai/src/wow_srp_fmt_plug.c:336 get_salt Shadow bytes around the buggy address: 0x00008023b400: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x00008023b410: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x00008023b420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00008023b430: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x00008023b440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x00008023b450: 00 00 00 00[01]f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x00008023b460: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x00008023b470: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x00008023b480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00008023b490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00008023b4a0: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 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 ==17460==ABORTING Aborted (core dumped) ``` #2. gdb Debug ``` C Program received signal SIGABRT, Aborted. 0x00007ffff5790cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007ffff5790cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff57940d8 in __GI_abort () at abort.c:89 #2 0x00007ffff6f640e9 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1 #3 0x00007ffff6f5bde5 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1 #4 0x00007ffff6f5fbe2 in ?? () from /usr/lib/x86_64-linux-gnu/libasan.so.1 #5 0x00007ffff6f5b279 in __asan_report_error () from /usr/lib/x86_64-linux-gnu/libasan.so.1 #6 0x00007ffff6f5c0c4 in __asan_report_load1 () from /usr/lib/x86_64-linux-gnu/libasan.so.1 #7 0x0000000000901813 in get_salt (ciphertext=0x121a200 <ct> "$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$", '0' <repeats 87 times>) at wow_srp_fmt_plug.c:336 #8 0x0000000000950b52 in ldr_load_pw_line (db=0x1225e80 <database>, line=0x7ffffffce690 "$WoWSRP$A35DCC134159A34F1D411DA7F38AB064B617D5DBDD9258FE2F23D5AB1CF3F685$", '0' <repeats 100 times>, "73616C7432*DIZ") at loader.c:916 #9 0x000000000094b504 in read_file (db=0x1225e80 <database>, name=0x631000000868 "err_pwfiles/pwfile.WoWSRP", flags=2, process_line=0x94fd2d <ldr_load_pw_line>) at loader.c:135 #10 0x0000000000951e4f in ldr_load_pw_file (db=0x1225e80 <database>, name=0x631000000868 "err_pwfiles/pwfile.WoWSRP") at loader.c:1019 #11 0x000000000094758d in john_load () at john.c:1023 #12 0x0000000000948cec in john_init (name=0x7fffffffec31 "john", argc=2, argv=0x7fffffffe998) at john.c:1307 #13 0x000000000094a8b4 in main (argc=2, argv=0x7fffffffe998) at john.c:1748 (gdb) ```
bsakaguchi 2026-10-14 03:31:55 +07:00
  • closed this issue
  • added the
    bug
    label
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#1017
No description provided.