[GH-ISSUE #1394] NETLMv2_fmt: malloc(): memory corruption (fast) [1] #886

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

Originally created by @loverszhaokai on GitHub (Jun 7, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1394

This bug is found by afl.
#1. Reproduce

$ ./configure && make -sj8
$ cat pwfile

$DCC2$test#a86012faf7d88d1fc037a69764a92cac
$DCC2$test3#360e51304a2d383ea33467ab0b639cc4
$DCC2$10240#test4#6f79ee93518306f071c47185998566ae
$DCC2$january#26b5495b21f9ad58255d99b5e117abe2
$DCC2$february#469�75e:8b5770b989aa2f0d371195ff
$DCC2$nineteen_characters#c4201b8267d74a2db1d5d19f5c9f7b57
$DCC2$nineteen_characters#87136ae0a18b2dafe4a41d555425b2ed
!DCC2$administrator#56f8c24c5a914299db41f70e9b43f36d
$DCC2�AdMiNiStRaToR#56f8C24c5A914299Db41F70e9b4t7HSIXw3.QP7.R240#TEST2#c6758e5be7fc943d#dighteencharacters#fc5df74eca97afd7cd5a�b0032496223
$DCC2$john-the-ripper#495c800a038d11e55fafc001eb689d1d
$DCC2$#59137848828d14b1fca295a5032b52a1
$DCC2$10240#nineteen_characters#cda4cef92db4398ce648a8fed8dc6853
$DCC2$10240#123456�890123456789012345678901234567890123:56789012345678901234567890123456789012345=7890123456789012345678901234567890123456eca97afd7cd5abb0032496223
$DCC26d45
$DCC2$mwentytwoXX_char���cters#c22936e38aac84474d9a4821b196ef5c
$DCC2$10000#Twelve_chars#54236c670e185043c8016006c001e982

$ ./john pwfile

Warning: detected hash type "HMAC-MD5", but the string is also recognized as "mscash2"
Use the "--format=mscash2" option to force loading these as that type instead
Warning: invalid UTF-8 seen reading out/crashes/id:000007,sig:06,src:000022,op:havoc,rep:16
*** Error in `../../john': malloc(): memory corruption (fast): 0x0000000002d02180 ***
Aborted

#2. GDB debug

Program received signal SIGABRT, Aborted.
0x00007ffff6668cc9 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  0x00007ffff6668cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff666c0d8 in __GI_abort () at abort.c:89
#2  0x00007ffff66a5394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff67b3b28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff66b166e in malloc_printerr (ptr=<optimized out>, str=0x7ffff67b3cc8 "free(): invalid next size (fast)", action=1) at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#5  0x00000000004af156 in prepare (split_fields=0x0, self=0x7a6973207478656e) at NETLMv2_fmt_plug.c:233
#6  0x00000000005cd08e in ldr_split_line (login=0x0, ciphertext=0x1d671, ciphertext@entry=0x7ffffffce608, gecos=0x6, gecos@entry=0x7ffffffce610,
    home=0x7ffff6668cc9 <__GI_raise+57>, home@entry=0x7ffffffce618, uid=0x3, source=0x93bac0 <fmt_NETLMv2> "\230\230d", format=0xfac228 <database+104>,
    db_opts=0xfac228 <database+104>, line=0x0) at loader.c:640
#7  0x00000000005cdb1e in ldr_load_pw_line (db=0xfac1c0 <database>, line=<optimized out>) at loader.c:802
#8  0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000007,sig:06,src:000022,op:havoc,rep:16", flags=<optimized out>,
    process_line=0x5cdae0 <ldr_load_pw_line>) at loader.c:135
#9  0x00000000005c9f5a in john_load () at john.c:1006
#10 0x00000000005ca7f5 in john_init (name=0x7fffffffec0c "john", argc=2, argv=0x7fffffffe978) at john.c:1290
#11 0x00000000005cb4e6 in main (argc=2, argv=0x7fffffffe978) at john.c:1730
Originally created by @loverszhaokai on GitHub (Jun 7, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1394 This bug is found by afl. #1. Reproduce $ ./configure && make -sj8 $ cat pwfile ``` $DCC2$test#a86012faf7d88d1fc037a69764a92cac $DCC2$test3#360e51304a2d383ea33467ab0b639cc4 $DCC2$10240#test4#6f79ee93518306f071c47185998566ae $DCC2$january#26b5495b21f9ad58255d99b5e117abe2 $DCC2$february#469�75e:8b5770b989aa2f0d371195ff $DCC2$nineteen_characters#c4201b8267d74a2db1d5d19f5c9f7b57 $DCC2$nineteen_characters#87136ae0a18b2dafe4a41d555425b2ed !DCC2$administrator#56f8c24c5a914299db41f70e9b43f36d $DCC2�AdMiNiStRaToR#56f8C24c5A914299Db41F70e9b4t7HSIXw3.QP7.R240#TEST2#c6758e5be7fc943d#dighteencharacters#fc5df74eca97afd7cd5a�b0032496223 $DCC2$john-the-ripper#495c800a038d11e55fafc001eb689d1d $DCC2$#59137848828d14b1fca295a5032b52a1 $DCC2$10240#nineteen_characters#cda4cef92db4398ce648a8fed8dc6853 $DCC2$10240#123456�890123456789012345678901234567890123:56789012345678901234567890123456789012345=7890123456789012345678901234567890123456eca97afd7cd5abb0032496223 $DCC26d45 $DCC2$mwentytwoXX_char���cters#c22936e38aac84474d9a4821b196ef5c $DCC2$10000#Twelve_chars#54236c670e185043c8016006c001e982 ``` $ ./john pwfile ``` C Warning: detected hash type "HMAC-MD5", but the string is also recognized as "mscash2" Use the "--format=mscash2" option to force loading these as that type instead Warning: invalid UTF-8 seen reading out/crashes/id:000007,sig:06,src:000022,op:havoc,rep:16 *** Error in `../../john': malloc(): memory corruption (fast): 0x0000000002d02180 *** Aborted ``` #2. GDB debug ``` C Program received signal SIGABRT, Aborted. 0x00007ffff6668cc9 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 0x00007ffff6668cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff666c0d8 in __GI_abort () at abort.c:89 #2 0x00007ffff66a5394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff67b3b28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175 #3 0x00007ffff66b166e in malloc_printerr (ptr=<optimized out>, str=0x7ffff67b3cc8 "free(): invalid next size (fast)", action=1) at malloc.c:4996 #4 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840 #5 0x00000000004af156 in prepare (split_fields=0x0, self=0x7a6973207478656e) at NETLMv2_fmt_plug.c:233 #6 0x00000000005cd08e in ldr_split_line (login=0x0, ciphertext=0x1d671, ciphertext@entry=0x7ffffffce608, gecos=0x6, gecos@entry=0x7ffffffce610, home=0x7ffff6668cc9 <__GI_raise+57>, home@entry=0x7ffffffce618, uid=0x3, source=0x93bac0 <fmt_NETLMv2> "\230\230d", format=0xfac228 <database+104>, db_opts=0xfac228 <database+104>, line=0x0) at loader.c:640 #7 0x00000000005cdb1e in ldr_load_pw_line (db=0xfac1c0 <database>, line=<optimized out>) at loader.c:802 #8 0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000007,sig:06,src:000022,op:havoc,rep:16", flags=<optimized out>, process_line=0x5cdae0 <ldr_load_pw_line>) at loader.c:135 #9 0x00000000005c9f5a in john_load () at john.c:1006 #10 0x00000000005ca7f5 in john_init (name=0x7fffffffec0c "john", argc=2, argv=0x7fffffffe978) at john.c:1290 #11 0x00000000005cb4e6 in main (argc=2, argv=0x7fffffffe978) at john.c:1730 ```
bsakaguchi 2026-10-14 03:27:06 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jfoug commented on GitHub (Jun 22, 2015):

Can this issue be checked out after cf9c4c1

<!-- gh-comment-id:114081975 --> @jfoug commented on GitHub (Jun 22, 2015): Can this issue be checked out after cf9c4c1
Author
Owner

@loverszhaokai commented on GitHub (Jun 23, 2015):

@jfoug Fixed. Thanks.

<!-- gh-comment-id:114483022 --> @loverszhaokai commented on GitHub (Jun 23, 2015): @jfoug Fixed. Thanks.
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#886
No description provided.