[GH-ISSUE #2005] ASan: heap-buffer-overflow for agilekeychain format when fuzzing #1347

Closed
opened 2026-10-14 03:45:07 +07:00 by bsakaguchi · 24 comments
Owner

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

Originally assigned to: @frank-dittrich on GitHub.

This is with scrypt format disabled due to https://github.com/magnumripper/JohnTheRipper/issues/2003

(bleeding-jumbo)run $ ./john --fuzz --format=cpu-dynamic
Fuzzing: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... 
Fuzzing: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 AVX-16]... 
Fuzzing: md5crypt, crypt(3) $1$ [MD5 128/128 AVX 4x3]... 
Warning: excessive partial hash collisions detected
Fuzzing: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... 
Fuzzing: LM [DES 128/128 AVX-16]... 
Fuzzing: AFS, Kerberos AFS [DES 48/64 4K]... 
Fuzzing: tripcode [DES 128/128 AVX-16]... 
Fuzzing: agilekeychain, 1Password Agile Keychain [PBKDF2-SHA1 AES 128/128 AVX 4x]... 
=================================================================
==11281==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6310082d8800 at pc 0x7ff23e2d5a96 bp 0x7fffc00e6500 sp 0x7fffc00e5ca8
READ of size 2124 at 0x6310082d8800 thread T0
    #0 0x7ff23e2d5a95 in memcmp (/lib64/libasan.so.2+0x77a95)
    #1 0x7ae637 in dyna_salt_cmp /home/fd/git/JtR/src/dyna_salt.c:105
    #2 0x7ec2e6 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:918
    #3 0x8628a9 in fuzz_test /home/fd/git/JtR/src/fuzz.c:564
    #4 0x862d94 in fuzz /home/fd/git/JtR/src/fuzz.c:668
    #5 0x7e5a49 in john_run /home/fd/git/JtR/src/john.c:1592
    #6 0x7e72cd in main /home/fd/git/JtR/src/john.c:1973
    #7 0x7ff23c85c6ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #8 0x406638 in _start (/home/fd/git/JtR/run/john+0x406638)

0x6310082d8800 is located 0 bytes to the right of 65536-byte region [0x6310082c8800,0x6310082d8800)
allocated by thread T0 here:
    #0 0x7ff23e2f696a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x80f7ae in mem_alloc_func /home/fd/git/JtR/src/memory.c:91
    #2 0x80f997 in mem_alloc_tiny_func /home/fd/git/JtR/src/memory.c:199
    #3 0x80fbf1 in str_alloc_copy_func /home/fd/git/JtR/src/memory.c:326
    #4 0x7eca75 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:984
    #5 0x8628a9 in fuzz_test /home/fd/git/JtR/src/fuzz.c:564
    #6 0x862d94 in fuzz /home/fd/git/JtR/src/fuzz.c:668
    #7 0x7e5a49 in john_run /home/fd/git/JtR/src/john.c:1592
    #8 0x7e72cd in main /home/fd/git/JtR/src/john.c:1973
    #9 0x7ff23c85c6ff in __libc_start_main (/lib64/libc.so.6+0x206ff)

SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 memcmp
Shadow bytes around the buggy address:
  0x0c62810530b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c62810530c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c62810530d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c62810530e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c62810530f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c6281053100:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c6281053110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c6281053120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c6281053130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c6281053140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c6281053150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==11281==ABORTING
(bleeding-jumbo)run $ ./john --list=build-info 
Version: 1.8.0.6-jumbo-1-1912-g691fc03
Build: linux-gnu 64-bit AVX-ac ASan UbSan
SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
$JOHN is ./
Format interface version: 13
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 5.3.1
GNU libc version: 2.21 (loaded: 2.21)
Crypto library: OpenSSL
OpenSSL library version: 0100010bf
OpenSSL 1.0.1k-fips 8 Jan 2015
GMP library version: 6.0.0
Regex library version: 1.3  (loaded: 1.3.1)
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's
Built with these debugging options
    ASan (Address Sanitizer debugging)
    UbSan (Undefined Behavior Sanitizer debugging)

Originally created by @frank-dittrich on GitHub (Jan 22, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2005 Originally assigned to: @frank-dittrich on GitHub. This is with scrypt format disabled due to https://github.com/magnumripper/JohnTheRipper/issues/2003 ``` (bleeding-jumbo)run $ ./john --fuzz --format=cpu-dynamic Fuzzing: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... Fuzzing: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 AVX-16]... Fuzzing: md5crypt, crypt(3) $1$ [MD5 128/128 AVX 4x3]... Warning: excessive partial hash collisions detected Fuzzing: bcrypt ("$2a$05", 32 iterations) [Blowfish 32/64 X3]... Fuzzing: LM [DES 128/128 AVX-16]... Fuzzing: AFS, Kerberos AFS [DES 48/64 4K]... Fuzzing: tripcode [DES 128/128 AVX-16]... Fuzzing: agilekeychain, 1Password Agile Keychain [PBKDF2-SHA1 AES 128/128 AVX 4x]... ================================================================= ==11281==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6310082d8800 at pc 0x7ff23e2d5a96 bp 0x7fffc00e6500 sp 0x7fffc00e5ca8 READ of size 2124 at 0x6310082d8800 thread T0 #0 0x7ff23e2d5a95 in memcmp (/lib64/libasan.so.2+0x77a95) #1 0x7ae637 in dyna_salt_cmp /home/fd/git/JtR/src/dyna_salt.c:105 #2 0x7ec2e6 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:918 #3 0x8628a9 in fuzz_test /home/fd/git/JtR/src/fuzz.c:564 #4 0x862d94 in fuzz /home/fd/git/JtR/src/fuzz.c:668 #5 0x7e5a49 in john_run /home/fd/git/JtR/src/john.c:1592 #6 0x7e72cd in main /home/fd/git/JtR/src/john.c:1973 #7 0x7ff23c85c6ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #8 0x406638 in _start (/home/fd/git/JtR/run/john+0x406638) 0x6310082d8800 is located 0 bytes to the right of 65536-byte region [0x6310082c8800,0x6310082d8800) allocated by thread T0 here: #0 0x7ff23e2f696a in malloc (/lib64/libasan.so.2+0x9896a) #1 0x80f7ae in mem_alloc_func /home/fd/git/JtR/src/memory.c:91 #2 0x80f997 in mem_alloc_tiny_func /home/fd/git/JtR/src/memory.c:199 #3 0x80fbf1 in str_alloc_copy_func /home/fd/git/JtR/src/memory.c:326 #4 0x7eca75 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:984 #5 0x8628a9 in fuzz_test /home/fd/git/JtR/src/fuzz.c:564 #6 0x862d94 in fuzz /home/fd/git/JtR/src/fuzz.c:668 #7 0x7e5a49 in john_run /home/fd/git/JtR/src/john.c:1592 #8 0x7e72cd in main /home/fd/git/JtR/src/john.c:1973 #9 0x7ff23c85c6ff in __libc_start_main (/lib64/libc.so.6+0x206ff) SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 memcmp Shadow bytes around the buggy address: 0x0c62810530b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c62810530c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c62810530d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c62810530e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c62810530f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c6281053100:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c6281053110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c6281053120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c6281053130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c6281053140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c6281053150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 ==11281==ABORTING ``` ``` (bleeding-jumbo)run $ ./john --list=build-info Version: 1.8.0.6-jumbo-1-1912-g691fc03 Build: linux-gnu 64-bit AVX-ac ASan UbSan SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1 $JOHN is ./ Format interface version: 13 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 SALT_HASH_SIZE: 1048576 Max. Markov mode level: 400 Max. Markov mode password length: 30 gcc version: 5.3.1 GNU libc version: 2.21 (loaded: 2.21) Crypto library: OpenSSL OpenSSL library version: 0100010bf OpenSSL 1.0.1k-fips 8 Jan 2015 GMP library version: 6.0.0 Regex library version: 1.3 (loaded: 1.3.1) File locking: fcntl() fseek(): fseek ftell(): ftell fopen(): fopen memmem(): System's Built with these debugging options ASan (Address Sanitizer debugging) UbSan (Undefined Behavior Sanitizer debugging) ```
bsakaguchi 2026-10-14 03:45:07 +07:00
  • closed this issue
  • added the
    fuzz bug
    label
Author
Owner

@magnumripper commented on GitHub (Jan 23, 2016):

Do we know exactly what --fuzz option did, that triggered this? If yes, please include that. If no, let's ditch the fuzz option.

<!-- gh-comment-id:174159902 --> @magnumripper commented on GitHub (Jan 23, 2016): Do we know exactly what --fuzz option did, that triggered this? If yes, please include that. If no, let's ditch the fuzz option.
Author
Owner

@frank-dittrich commented on GitHub (Jan 23, 2016):

Yes, you can recreate the fuzzed data with

./john --fuzz-dump --format=agilekeychain
Fuzzing: agilekeychain, 1Password Agile Keychain [PBKDF2-SHA1 AES 128/128 AVX 4x]...
All 1 formats passed fuzzing test!

The screen output of --fuzz-dump is confusing, since --fuzz-dump isn't really fuzzing the format.
Instead, it is producing a file pwfile.agilekeychain with fuzzed hashes, and you can then run that format using this file with fuzzed hashes.
(I think the screen output for --fuzz-dump should be changed. I'll look into that.)

Unfortunately, when fuzzing agilekeychain as a single format, you don't get that ASan error.
Instead, after running for more than 20 minutes, it gets killed (due to hitting ulimit; I noticed that top reported several gigabytes RES when john ran for a while.
So, in this case, the --fuzz-dump output might be somewhat less useful.

BTW, I verified that the pwfile. for a particular format is always the same (for a given build).
For https://github.com/magnumripper/JohnTheRipper/issues/2003, I've done that test.
(Because I was afraid that --fuzz wouldn't produce the same data when running against an individual format.)
So, it doesn't matter whether you specify --format= or not (except that you might not have enough disk space to store the fuzzed hashes of all formats.

Just now I checked out commit c18330124c (see issue https://github.com/magnumripper/JohnTheRipper/issues/2004, meanwhile fixed by Jim), and tested this procedure:

((HEAD detached at c183301))run $ ./john --fuzz-dump --format='dynamic=md4(MD4($p).$s.md4($p))'
Fuzzing: dynamic= [128/128 AVX 4x3]... 
All 1 formats passed fuzzing test!
((HEAD detached at c183301))run $ ls -t |head -n 1
pwfile.dynamic=

So the file extension doesn't contain the full format string.
May be we should try to fix that.

((HEAD detached at c183301))run $ ./john --format='dynamic=md4(MD4($p).$s.md4($p))' pwfile.dynamic\= 
Warning: invalid UTF-8 seen reading pwfile.dynamic=
=================================================================
==2676==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ed9060 at pc 0x7fdf22d26b29 bp 0x7ffd3ab16cc0 sp 0x7ffd3ab16468
WRITE of size 1050 at 0x000000ed9060 thread T0
    #0 0x7fdf22d26b28  (/lib64/libasan.so.2+0x62b28)
    #1 0x5a63c8 in dynamic_expr_normalize /home/fd/git/JtR/src/dynamic_compiler.c:301
    #2 0x5c89fd in dynamic_compile_prepare /home/fd/git/JtR/src/dynamic_compiler.c:2373
    #3 0x67e523 in our_prepare /home/fd/git/JtR/src/dynamic_compiler_fmt_plug.c:120
    #4 0x7ea973 in ldr_split_line /home/fd/git/JtR/src/loader.c:629
    #5 0x7ebab9 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:827
    #6 0x7ed357 in read_file /home/fd/git/JtR/src/loader.c:147
    #7 0x7f0933 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1023
    #8 0x7e33e0 in john_load /home/fd/git/JtR/src/john.c:1170
    #9 0x7e50ea in john_init /home/fd/git/JtR/src/john.c:1499
    #10 0x7e71ae in main /home/fd/git/JtR/src/john.c:1960
    #11 0x7fdf212c26ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #12 0x406638 in _start (/home/fd/git/JtR/run/john+0x406638)

0x000000ed9060 is located 32 bytes to the left of global variable 'Buf' defined in 'dynamic_compiler.c:260:15' (0xed9080) of size 512
0x000000ed9060 is located 0 bytes to the right of global variable 'Buf' defined in 'dynamic_compiler.c:299:15' (0xed8e60) of size 512
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 ??
Shadow bytes around the buggy address:
  0x0000801d31b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d31c0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00
  0x0000801d31d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d31e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d31f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0000801d3200: 00 00 00 00 00 00 00 00 00 00 00 00[f9]f9 f9 f9
  0x0000801d3210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d3220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d3230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d3240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d3250: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
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
==2676==ABORTING

The top entries of the stack

    #0 0x7f351c219b28  (/lib64/libasan.so.2+0x62b28)
    #1 0x5a63c8 in dynamic_expr_normalize /home/fd/git/JtR/src/dynamic_compiler.c:301
    #2 0x5c89fd in dynamic_compile_prepare /home/fd/git/JtR/src/dynamic_compiler.c:2373
    #3 0x67e523 in our_prepare /home/fd/git/JtR/src/dynamic_compiler_fmt_plug.c:120
    #4 0x7ea973 in ldr_split_line /home/fd/git/JtR/src/loader.c:629
    #5 0x7ebab9 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:827

are exactly the same as those when running --fuzz.

<!-- gh-comment-id:174170144 --> @frank-dittrich commented on GitHub (Jan 23, 2016): Yes, you can recreate the fuzzed data with ``` ./john --fuzz-dump --format=agilekeychain Fuzzing: agilekeychain, 1Password Agile Keychain [PBKDF2-SHA1 AES 128/128 AVX 4x]... All 1 formats passed fuzzing test! ``` The screen output of --fuzz-dump is confusing, since --fuzz-dump isn't really fuzzing the format. Instead, it is producing a file pwfile.agilekeychain with fuzzed hashes, and you can then run that format using this file with fuzzed hashes. (I think the screen output for --fuzz-dump should be changed. I'll look into that.) Unfortunately, when fuzzing agilekeychain as a single format, you don't get that ASan error. Instead, after running for more than 20 minutes, it gets killed (due to hitting ulimit; I noticed that top reported several gigabytes RES when john ran for a while. So, in this case, the --fuzz-dump output might be somewhat less useful. BTW, I verified that the pwfile.<format> for a particular format is always the same (for a given build). For https://github.com/magnumripper/JohnTheRipper/issues/2003, I've done that test. (Because I was afraid that --fuzz wouldn't produce the same data when running against an individual format.) So, it doesn't matter whether you specify --format= or not (except that you might not have enough disk space to store the fuzzed hashes of all formats. Just now I checked out commit c18330124c9208c39aa7dbbea1c54a4cd5b8be12 (see issue https://github.com/magnumripper/JohnTheRipper/issues/2004, meanwhile fixed by Jim), and tested this procedure: ``` ((HEAD detached at c183301))run $ ./john --fuzz-dump --format='dynamic=md4(MD4($p).$s.md4($p))' Fuzzing: dynamic= [128/128 AVX 4x3]... All 1 formats passed fuzzing test! ((HEAD detached at c183301))run $ ls -t |head -n 1 pwfile.dynamic= ``` So the file extension doesn't contain the full format string. May be we should try to fix that. ``` ((HEAD detached at c183301))run $ ./john --format='dynamic=md4(MD4($p).$s.md4($p))' pwfile.dynamic\= Warning: invalid UTF-8 seen reading pwfile.dynamic= ================================================================= ==2676==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ed9060 at pc 0x7fdf22d26b29 bp 0x7ffd3ab16cc0 sp 0x7ffd3ab16468 WRITE of size 1050 at 0x000000ed9060 thread T0 #0 0x7fdf22d26b28 (/lib64/libasan.so.2+0x62b28) #1 0x5a63c8 in dynamic_expr_normalize /home/fd/git/JtR/src/dynamic_compiler.c:301 #2 0x5c89fd in dynamic_compile_prepare /home/fd/git/JtR/src/dynamic_compiler.c:2373 #3 0x67e523 in our_prepare /home/fd/git/JtR/src/dynamic_compiler_fmt_plug.c:120 #4 0x7ea973 in ldr_split_line /home/fd/git/JtR/src/loader.c:629 #5 0x7ebab9 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:827 #6 0x7ed357 in read_file /home/fd/git/JtR/src/loader.c:147 #7 0x7f0933 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1023 #8 0x7e33e0 in john_load /home/fd/git/JtR/src/john.c:1170 #9 0x7e50ea in john_init /home/fd/git/JtR/src/john.c:1499 #10 0x7e71ae in main /home/fd/git/JtR/src/john.c:1960 #11 0x7fdf212c26ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #12 0x406638 in _start (/home/fd/git/JtR/run/john+0x406638) 0x000000ed9060 is located 32 bytes to the left of global variable 'Buf' defined in 'dynamic_compiler.c:260:15' (0xed9080) of size 512 0x000000ed9060 is located 0 bytes to the right of global variable 'Buf' defined in 'dynamic_compiler.c:299:15' (0xed8e60) of size 512 SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 ?? Shadow bytes around the buggy address: 0x0000801d31b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d31c0: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00 0x0000801d31d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d31e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d31f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0000801d3200: 00 00 00 00 00 00 00 00 00 00 00 00[f9]f9 f9 f9 0x0000801d3210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d3220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d3230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d3240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d3250: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 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 ==2676==ABORTING ``` The top entries of the stack ``` #0 0x7f351c219b28 (/lib64/libasan.so.2+0x62b28) #1 0x5a63c8 in dynamic_expr_normalize /home/fd/git/JtR/src/dynamic_compiler.c:301 #2 0x5c89fd in dynamic_compile_prepare /home/fd/git/JtR/src/dynamic_compiler.c:2373 #3 0x67e523 in our_prepare /home/fd/git/JtR/src/dynamic_compiler_fmt_plug.c:120 #4 0x7ea973 in ldr_split_line /home/fd/git/JtR/src/loader.c:629 #5 0x7ebab9 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:827 ``` are exactly the same as those when running --fuzz.
Author
Owner

@frank-dittrich commented on GitHub (Jan 23, 2016):

Of course, you can also use

./john --fuzz=pwfile.<format> --format=...

So, there's no need to try any real cracking mode on that file.

<!-- gh-comment-id:174176977 --> @frank-dittrich commented on GitHub (Jan 23, 2016): Of course, you can also use ``` ./john --fuzz=pwfile.<format> --format=... ``` So, there's no need to try any real cracking mode on that file.
Author
Owner

@jfoug commented on GitHub (Jan 23, 2016):

let's ditch the fuzz option.

The fuzz option has it's purpose. After I reverted that change so that --fuzz-dump does not kill the files, you can --fuzz until a problem, then get the raw file for that format, and start finding the exact line that caused the crash or ASAN fail. --fuzz is simply a summation in C code of all the fuzzing perl scripts used by many folks to ferret out overwrites and other crap.

<!-- gh-comment-id:174187817 --> @jfoug commented on GitHub (Jan 23, 2016): > let's ditch the fuzz option. The fuzz option has it's purpose. After I reverted that change so that --fuzz-dump does not kill the files, you can --fuzz until a problem, then get the raw file for that format, and start finding the exact line that caused the crash or ASAN fail. --fuzz is simply a summation in C code of all the fuzzing perl scripts used by many folks to ferret out overwrites and other crap.
Author
Owner

@jfoug commented on GitHub (Jan 23, 2016):

Note, we probably should change --fuzz-dump to ONLY work if a single --format= is used.

<!-- gh-comment-id:174187844 --> @jfoug commented on GitHub (Jan 23, 2016): Note, we probably should change --fuzz-dump to ONLY work if a single --format= is used.
Author
Owner

@frank-dittrich commented on GitHub (Jan 23, 2016):

Requiring --format for --fuzz-dump is a good idea, but may be we can still allow generic format specifications.

For now, I at least adjusted screen output for --fuzz-dump, to avoid the kind of confusion that made me open issue https://github.com/magnumripper/JohnTheRipper/issues/1969

(bleeding-jumbo)run $ ./john --fuzz-dump --format=sap*
Generating pwfile.sapb for sapb, SAP CODVN B (BCODE) ...
Generating pwfile.sapg for sapg, SAP CODVN F/G (PASSCODE) ...
Generating pwfile.saph for saph, SAP CODVN H (PWDSALTEDHASH) (SHA1x1024) ...
Generated pwfile.<format> for 3 formats
<!-- gh-comment-id:174192311 --> @frank-dittrich commented on GitHub (Jan 23, 2016): Requiring --format for --fuzz-dump is a good idea, but may be we can still allow generic format specifications. For now, I at least adjusted screen output for --fuzz-dump, to avoid the kind of confusion that made me open issue https://github.com/magnumripper/JohnTheRipper/issues/1969 ``` (bleeding-jumbo)run $ ./john --fuzz-dump --format=sap* Generating pwfile.sapb for sapb, SAP CODVN B (BCODE) ... Generating pwfile.sapg for sapg, SAP CODVN F/G (PASSCODE) ... Generating pwfile.saph for saph, SAP CODVN H (PWDSALTEDHASH) (SHA1x1024) ... Generated pwfile.<format> for 3 formats ```
Author
Owner

@frank-dittrich commented on GitHub (Jan 23, 2016):

(bleeding-jumbo)run $ ./john --fuzz-dump --format=agilekeychain
Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71343700831 bytes
Generated pwfile.<format> for 1 formats

With that amount of data, it is no surprise that john --fuzz fails:

(bleeding-jumbo)run $ ./john --format=agilekeychain --fuzz=pwfile.agilekeychain 
fuzz: memory mapping failed (No such file or directory)

memory mapping failed, but not because that file doesn't exist.

I'll see whether I can get agilekeychain fuzzing to fail with a smaller sample.

<!-- gh-comment-id:174198522 --> @frank-dittrich commented on GitHub (Jan 23, 2016): ``` (bleeding-jumbo)run $ ./john --fuzz-dump --format=agilekeychain Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71343700831 bytes Generated pwfile.<format> for 1 formats ``` With that amount of data, it is no surprise that john --fuzz fails: ``` (bleeding-jumbo)run $ ./john --format=agilekeychain --fuzz=pwfile.agilekeychain fuzz: memory mapping failed (No such file or directory) ``` memory mapping failed, but not because that file doesn't exist. I'll see whether I can get agilekeychain fuzzing to fail with a smaller sample.
Author
Owner

@frank-dittrich commented on GitHub (Jan 23, 2016):

(bleeding-jumbo)run $ wc -l pwfile.agilekeychain
132849036 pwfile.agilekeychain
<!-- gh-comment-id:174198680 --> @frank-dittrich commented on GitHub (Jan 23, 2016): ``` (bleeding-jumbo)run $ wc -l pwfile.agilekeychain 132849036 pwfile.agilekeychain ```
Author
Owner

@magnumripper commented on GitHub (Sep 19, 2016):

Perhaps time to re-test this issue after all recent fixes in format and in core?

<!-- gh-comment-id:248110501 --> @magnumripper commented on GitHub (Sep 19, 2016): Perhaps time to re-test this issue after all recent fixes in format and in core?
Author
Owner

@frank-dittrich commented on GitHub (Sep 19, 2016):

@magnumripper I will not be able to re-test for the next 2 weeks, but after those two weeks, I can test this.
BTW: I might somehow adjust --fuzz-fump or make it configurable, because (after the recent fuzz-dump changes, it generates more than 50 GB of test data for just for agilekeychain format.
This is insane.

<!-- gh-comment-id:248134263 --> @frank-dittrich commented on GitHub (Sep 19, 2016): @magnumripper I will not be able to re-test for the next 2 weeks, but after those two weeks, I can test this. BTW: I might somehow adjust --fuzz-fump or make it configurable, because (after the recent fuzz-dump changes, it generates more than 50 GB of test data for just for agilekeychain format. This is insane.
Author
Owner

@frank-dittrich commented on GitHub (Oct 13, 2016):

With 1.8.0-jumbo-1-5362-g2207c2c, I repeated the agilekeychain test:

$ ./john --fuzz-dump --format=agilekeychain
Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71375639083 bytes
Generated pwfile.<format> for 1 formats

Unfortunately, john was running out of memory. (To be expected if there are too many "valid" hashes in the fuzzed data.)

$ ./john --format=agilekeychain --wordlist --max-run-time=1 pwfile.agilekeychain 
Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71375639083 bytes
Generated pwfile.<format> for 1 formats
Warning: invalid UTF-8 seen reading pwfile.agilekeychain
Warning: check for duplicates partially bypassed to speedup loading
==15206==ERROR: AddressSanitizer failed to allocate 0x8003000 (134230016) bytes of LargeMmapAllocator (errno: 12)
==15206==Process memory map follows:
    0x000000400000-0x000000b2c000   /home/ubuntuadm/git/JtR/run/john
    0x000000d2c000-0x000000d2e000   /home/ubuntuadm/git/JtR/run/john
    0x000000d2e000-0x000000e8f000   /home/ubuntuadm/git/JtR/run/john
    0x000000e8f000-0x00000115c000   
    0x00007fff7000-0x00008fff7000   
    0x00008fff7000-0x02008fff7000   
    0x02008fff7000-0x10007fff8000   
    0x600000000000-0x602000000000   
    0x602000000000-0x602001ba0000   
    0x602001ba0000-0x603000000000   
    0x603000000000-0x603000010000   
    0x603000010000-0x604000000000   
    0x604000000000-0x604000010000   
    0x604000010000-0x606000000000   
    0x606000000000-0x606000010000   
    0x606000010000-0x607000000000   
    0x607000000000-0x607000010000   
    0x607000010000-0x608000000000   
    0x608000000000-0x608000010000   
    0x608000010000-0x60b000000000   
    0x60b000000000-0x60b000010000   
    0x60b000010000-0x60c000000000   
    0x60c000000000-0x60c000010000   
    0x60c000010000-0x60d000000000   
    0x60d000000000-0x60d000010000   
    0x60d000010000-0x60e000000000   
    0x60e000000000-0x60e000010000   
    0x60e000010000-0x60f000000000   
    0x60f000000000-0x60f000010000   
    0x60f000010000-0x610000000000   
    0x610000000000-0x610000010000   
    0x610000010000-0x611000000000   
    0x611000000000-0x611000010000   
    0x611000010000-0x612000000000   
    0x612000000000-0x612000010000   
    0x612000010000-0x613000000000   
    0x613000000000-0x613000010000   
    0x613000010000-0x614000000000   
    0x614000000000-0x614000020000   
    0x614000020000-0x615000000000   
    0x615000000000-0x615000020000   
    0x615000020000-0x616000000000   
    0x616000000000-0x616000020000   
    0x616000020000-0x617000000000   
    0x617000000000-0x617000020000   
    0x617000020000-0x618000000000   
    0x618000000000-0x618000020000   
    0x618000020000-0x619000000000   
    0x619000000000-0x619000020000   
    0x619000020000-0x61a000000000   
    0x61a000000000-0x61a000020000   
    0x61a000020000-0x61b000000000   
    0x61b000000000-0x61b000020000   
    0x61b000020000-0x61c000000000   
    0x61c000000000-0x61c000020000   
    0x61c000020000-0x61d000000000   
    0x61d000000000-0x61d000930000   
    0x61d000930000-0x61e000000000   
    0x61e000000000-0x61e000e00000   
    0x61e000e00000-0x61f000000000   
    0x61f000000000-0x61f001140000   
    0x61f001140000-0x620000000000   
    0x620000000000-0x620000420000   
    0x620000420000-0x621000000000   
    0x621000000000-0x6210912d0000   
    0x6210912d0000-0x622000000000   
    0x622000000000-0x622038e20000   
    0x622038e20000-0x623000000000   
    0x623000000000-0x623000020000   
    0x623000020000-0x624000000000   
    0x624000000000-0x624000020000   
    0x624000020000-0x628000000000   
    0x628000000000-0x6280989c0000   
    0x6280989c0000-0x631000000000   
    0x631000000000-0x6311f6fc0000   
    0x6311f6fc0000-0x640000000000   
    0x640000000000-0x640000003000   
    0x7feb9529f000-0x7feb9daa4000   
    0x7feb9daa4000-0x7feb9df00000   /usr/lib/locale/locale-archive
    0x7feb9df00000-0x7feb9e000000   
    0x7feb9e100000-0x7feb9e200000   
    0x7feb9e29a000-0x7feba05ec000   
    0x7feba05ec000-0x7feba0602000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7feba0602000-0x7feba0801000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7feba0801000-0x7feba0802000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7feba0802000-0x7feba0805000   /lib/x86_64-linux-gnu/libdl-2.23.so
    0x7feba0805000-0x7feba0a04000   /lib/x86_64-linux-gnu/libdl-2.23.so
    0x7feba0a04000-0x7feba0a05000   /lib/x86_64-linux-gnu/libdl-2.23.so
    0x7feba0a05000-0x7feba0a06000   /lib/x86_64-linux-gnu/libdl-2.23.so
    0x7feba0a06000-0x7feba0bc6000   /lib/x86_64-linux-gnu/libc-2.23.so
    0x7feba0bc6000-0x7feba0dc5000   /lib/x86_64-linux-gnu/libc-2.23.so
    0x7feba0dc5000-0x7feba0dc9000   /lib/x86_64-linux-gnu/libc-2.23.so
    0x7feba0dc9000-0x7feba0dcb000   /lib/x86_64-linux-gnu/libc-2.23.so
    0x7feba0dcb000-0x7feba0dcf000   
    0x7feba0dcf000-0x7feba0de7000   /lib/x86_64-linux-gnu/libpthread-2.23.so
    0x7feba0de7000-0x7feba0fe6000   /lib/x86_64-linux-gnu/libpthread-2.23.so
    0x7feba0fe6000-0x7feba0fe7000   /lib/x86_64-linux-gnu/libpthread-2.23.so
    0x7feba0fe7000-0x7feba0fe8000   /lib/x86_64-linux-gnu/libpthread-2.23.so
    0x7feba0fe8000-0x7feba0fec000   
    0x7feba0fec000-0x7feba0ffb000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x7feba0ffb000-0x7feba11fa000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x7feba11fa000-0x7feba11fb000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x7feba11fb000-0x7feba11fc000   /lib/x86_64-linux-gnu/libbz2.so.1.0.4
    0x7feba11fc000-0x7feba1205000   /lib/x86_64-linux-gnu/libcrypt-2.23.so
    0x7feba1205000-0x7feba1404000   /lib/x86_64-linux-gnu/libcrypt-2.23.so
    0x7feba1404000-0x7feba1405000   /lib/x86_64-linux-gnu/libcrypt-2.23.so
    0x7feba1405000-0x7feba1406000   /lib/x86_64-linux-gnu/libcrypt-2.23.so
    0x7feba1406000-0x7feba1434000   
    0x7feba1434000-0x7feba144d000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x7feba144d000-0x7feba164c000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x7feba164c000-0x7feba164d000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x7feba164d000-0x7feba164e000   /lib/x86_64-linux-gnu/libz.so.1.2.8
    0x7feba164e000-0x7feba1756000   /lib/x86_64-linux-gnu/libm-2.23.so
    0x7feba1756000-0x7feba1955000   /lib/x86_64-linux-gnu/libm-2.23.so
    0x7feba1955000-0x7feba1956000   /lib/x86_64-linux-gnu/libm-2.23.so
    0x7feba1956000-0x7feba1957000   /lib/x86_64-linux-gnu/libm-2.23.so
    0x7feba1957000-0x7feba19d6000   /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
    0x7feba19d6000-0x7feba1bd5000   /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
    0x7feba1bd5000-0x7feba1bd6000   /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
    0x7feba1bd6000-0x7feba1bd7000   /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
    0x7feba1bd7000-0x7feba1df1000   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    0x7feba1df1000-0x7feba1ff0000   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    0x7feba1ff0000-0x7feba200c000   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    0x7feba200c000-0x7feba2018000   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    0x7feba2018000-0x7feba201b000   
    0x7feba201b000-0x7feba2079000   /lib/x86_64-linux-gnu/libssl.so.1.0.0
    0x7feba2079000-0x7feba2279000   /lib/x86_64-linux-gnu/libssl.so.1.0.0
    0x7feba2279000-0x7feba227d000   /lib/x86_64-linux-gnu/libssl.so.1.0.0
    0x7feba227d000-0x7feba2284000   /lib/x86_64-linux-gnu/libssl.so.1.0.0
    0x7feba2284000-0x7feba2378000   /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
    0x7feba2378000-0x7feba2578000   /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
    0x7feba2578000-0x7feba257b000   /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
    0x7feba257b000-0x7feba257c000   /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0
    0x7feba257c000-0x7feba31f1000   
    0x7feba31f1000-0x7feba3217000   /lib/x86_64-linux-gnu/ld-2.23.so
    0x7feba32f8000-0x7feba33f2000   
    0x7feba33f2000-0x7feba3416000   
    0x7feba3416000-0x7feba3417000   /lib/x86_64-linux-gnu/ld-2.23.so
    0x7feba3417000-0x7feba3418000   /lib/x86_64-linux-gnu/ld-2.23.so
    0x7feba3418000-0x7feba3419000   
    0x7fffa2ef9000-0x7fffa2f1a000   [stack]
    0x7fffa2f50000-0x7fffa2f52000   [vvar]
    0x7fffa2f52000-0x7fffa2f54000   [vdso]
    0xffffffffff600000-0xffffffffff601000   [vsyscall]
==15206==End of process memory map.
==15206==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc:121 "(("unable to mmap" && 0)) != (0)" (0x0, 0x0)
    #0 0x7feba2324631  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa0631)
    #1 0x7feba2329613 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa5613)
    #2 0x7feba2331641  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xad641)
    #3 0x7feba22a6c0c  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x22c0c)
    #4 0x7feba22a7bf5  (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x23bf5)
    #5 0x7feba231c92f in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9892f)
    #6 0x7f42bd in fgetll /home/ubuntuadm/git/JtR/src/misc.c:181
    #7 0x7d8424 in read_file /home/ubuntuadm/git/JtR/src/loader.c:198
    #8 0x7db967 in ldr_load_pw_file /home/ubuntuadm/git/JtR/src/loader.c:1115
    #9 0x7ce833 in john_load /home/ubuntuadm/git/JtR/src/john.c:1181
    #10 0x7d0063 in john_init /home/ubuntuadm/git/JtR/src/john.c:1507
    #11 0x7d1f2d in main /home/ubuntuadm/git/JtR/src/john.c:1967
    #12 0x7feba0a2682f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #13 0x406338 in _start (/home/ubuntuadm/git/JtR/run/john+0x406338)

I'll try to split that huge pwfile.agilekeychain into smaller chunks, and process test cases of reasonable size, but that might take a while.

<!-- gh-comment-id:253580118 --> @frank-dittrich commented on GitHub (Oct 13, 2016): With `1.8.0-jumbo-1-5362-g2207c2c`, I repeated the agilekeychain test: ``` $ ./john --fuzz-dump --format=agilekeychain Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71375639083 bytes Generated pwfile.<format> for 1 formats ``` Unfortunately, john was running out of memory. (To be expected if there are too many "valid" hashes in the fuzzed data.) ``` $ ./john --format=agilekeychain --wordlist --max-run-time=1 pwfile.agilekeychain Generating pwfile.agilekeychain for agilekeychain, 1Password Agile Keychain ... 71375639083 bytes Generated pwfile.<format> for 1 formats Warning: invalid UTF-8 seen reading pwfile.agilekeychain Warning: check for duplicates partially bypassed to speedup loading ==15206==ERROR: AddressSanitizer failed to allocate 0x8003000 (134230016) bytes of LargeMmapAllocator (errno: 12) ==15206==Process memory map follows: 0x000000400000-0x000000b2c000 /home/ubuntuadm/git/JtR/run/john 0x000000d2c000-0x000000d2e000 /home/ubuntuadm/git/JtR/run/john 0x000000d2e000-0x000000e8f000 /home/ubuntuadm/git/JtR/run/john 0x000000e8f000-0x00000115c000 0x00007fff7000-0x00008fff7000 0x00008fff7000-0x02008fff7000 0x02008fff7000-0x10007fff8000 0x600000000000-0x602000000000 0x602000000000-0x602001ba0000 0x602001ba0000-0x603000000000 0x603000000000-0x603000010000 0x603000010000-0x604000000000 0x604000000000-0x604000010000 0x604000010000-0x606000000000 0x606000000000-0x606000010000 0x606000010000-0x607000000000 0x607000000000-0x607000010000 0x607000010000-0x608000000000 0x608000000000-0x608000010000 0x608000010000-0x60b000000000 0x60b000000000-0x60b000010000 0x60b000010000-0x60c000000000 0x60c000000000-0x60c000010000 0x60c000010000-0x60d000000000 0x60d000000000-0x60d000010000 0x60d000010000-0x60e000000000 0x60e000000000-0x60e000010000 0x60e000010000-0x60f000000000 0x60f000000000-0x60f000010000 0x60f000010000-0x610000000000 0x610000000000-0x610000010000 0x610000010000-0x611000000000 0x611000000000-0x611000010000 0x611000010000-0x612000000000 0x612000000000-0x612000010000 0x612000010000-0x613000000000 0x613000000000-0x613000010000 0x613000010000-0x614000000000 0x614000000000-0x614000020000 0x614000020000-0x615000000000 0x615000000000-0x615000020000 0x615000020000-0x616000000000 0x616000000000-0x616000020000 0x616000020000-0x617000000000 0x617000000000-0x617000020000 0x617000020000-0x618000000000 0x618000000000-0x618000020000 0x618000020000-0x619000000000 0x619000000000-0x619000020000 0x619000020000-0x61a000000000 0x61a000000000-0x61a000020000 0x61a000020000-0x61b000000000 0x61b000000000-0x61b000020000 0x61b000020000-0x61c000000000 0x61c000000000-0x61c000020000 0x61c000020000-0x61d000000000 0x61d000000000-0x61d000930000 0x61d000930000-0x61e000000000 0x61e000000000-0x61e000e00000 0x61e000e00000-0x61f000000000 0x61f000000000-0x61f001140000 0x61f001140000-0x620000000000 0x620000000000-0x620000420000 0x620000420000-0x621000000000 0x621000000000-0x6210912d0000 0x6210912d0000-0x622000000000 0x622000000000-0x622038e20000 0x622038e20000-0x623000000000 0x623000000000-0x623000020000 0x623000020000-0x624000000000 0x624000000000-0x624000020000 0x624000020000-0x628000000000 0x628000000000-0x6280989c0000 0x6280989c0000-0x631000000000 0x631000000000-0x6311f6fc0000 0x6311f6fc0000-0x640000000000 0x640000000000-0x640000003000 0x7feb9529f000-0x7feb9daa4000 0x7feb9daa4000-0x7feb9df00000 /usr/lib/locale/locale-archive 0x7feb9df00000-0x7feb9e000000 0x7feb9e100000-0x7feb9e200000 0x7feb9e29a000-0x7feba05ec000 0x7feba05ec000-0x7feba0602000 /lib/x86_64-linux-gnu/libgcc_s.so.1 0x7feba0602000-0x7feba0801000 /lib/x86_64-linux-gnu/libgcc_s.so.1 0x7feba0801000-0x7feba0802000 /lib/x86_64-linux-gnu/libgcc_s.so.1 0x7feba0802000-0x7feba0805000 /lib/x86_64-linux-gnu/libdl-2.23.so 0x7feba0805000-0x7feba0a04000 /lib/x86_64-linux-gnu/libdl-2.23.so 0x7feba0a04000-0x7feba0a05000 /lib/x86_64-linux-gnu/libdl-2.23.so 0x7feba0a05000-0x7feba0a06000 /lib/x86_64-linux-gnu/libdl-2.23.so 0x7feba0a06000-0x7feba0bc6000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7feba0bc6000-0x7feba0dc5000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7feba0dc5000-0x7feba0dc9000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7feba0dc9000-0x7feba0dcb000 /lib/x86_64-linux-gnu/libc-2.23.so 0x7feba0dcb000-0x7feba0dcf000 0x7feba0dcf000-0x7feba0de7000 /lib/x86_64-linux-gnu/libpthread-2.23.so 0x7feba0de7000-0x7feba0fe6000 /lib/x86_64-linux-gnu/libpthread-2.23.so 0x7feba0fe6000-0x7feba0fe7000 /lib/x86_64-linux-gnu/libpthread-2.23.so 0x7feba0fe7000-0x7feba0fe8000 /lib/x86_64-linux-gnu/libpthread-2.23.so 0x7feba0fe8000-0x7feba0fec000 0x7feba0fec000-0x7feba0ffb000 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 0x7feba0ffb000-0x7feba11fa000 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 0x7feba11fa000-0x7feba11fb000 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 0x7feba11fb000-0x7feba11fc000 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 0x7feba11fc000-0x7feba1205000 /lib/x86_64-linux-gnu/libcrypt-2.23.so 0x7feba1205000-0x7feba1404000 /lib/x86_64-linux-gnu/libcrypt-2.23.so 0x7feba1404000-0x7feba1405000 /lib/x86_64-linux-gnu/libcrypt-2.23.so 0x7feba1405000-0x7feba1406000 /lib/x86_64-linux-gnu/libcrypt-2.23.so 0x7feba1406000-0x7feba1434000 0x7feba1434000-0x7feba144d000 /lib/x86_64-linux-gnu/libz.so.1.2.8 0x7feba144d000-0x7feba164c000 /lib/x86_64-linux-gnu/libz.so.1.2.8 0x7feba164c000-0x7feba164d000 /lib/x86_64-linux-gnu/libz.so.1.2.8 0x7feba164d000-0x7feba164e000 /lib/x86_64-linux-gnu/libz.so.1.2.8 0x7feba164e000-0x7feba1756000 /lib/x86_64-linux-gnu/libm-2.23.so 0x7feba1756000-0x7feba1955000 /lib/x86_64-linux-gnu/libm-2.23.so 0x7feba1955000-0x7feba1956000 /lib/x86_64-linux-gnu/libm-2.23.so 0x7feba1956000-0x7feba1957000 /lib/x86_64-linux-gnu/libm-2.23.so 0x7feba1957000-0x7feba19d6000 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 0x7feba19d6000-0x7feba1bd5000 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 0x7feba1bd5000-0x7feba1bd6000 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 0x7feba1bd6000-0x7feba1bd7000 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0 0x7feba1bd7000-0x7feba1df1000 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 0x7feba1df1000-0x7feba1ff0000 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 0x7feba1ff0000-0x7feba200c000 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 0x7feba200c000-0x7feba2018000 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 0x7feba2018000-0x7feba201b000 0x7feba201b000-0x7feba2079000 /lib/x86_64-linux-gnu/libssl.so.1.0.0 0x7feba2079000-0x7feba2279000 /lib/x86_64-linux-gnu/libssl.so.1.0.0 0x7feba2279000-0x7feba227d000 /lib/x86_64-linux-gnu/libssl.so.1.0.0 0x7feba227d000-0x7feba2284000 /lib/x86_64-linux-gnu/libssl.so.1.0.0 0x7feba2284000-0x7feba2378000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0 0x7feba2378000-0x7feba2578000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0 0x7feba2578000-0x7feba257b000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0 0x7feba257b000-0x7feba257c000 /usr/lib/x86_64-linux-gnu/libasan.so.2.0.0 0x7feba257c000-0x7feba31f1000 0x7feba31f1000-0x7feba3217000 /lib/x86_64-linux-gnu/ld-2.23.so 0x7feba32f8000-0x7feba33f2000 0x7feba33f2000-0x7feba3416000 0x7feba3416000-0x7feba3417000 /lib/x86_64-linux-gnu/ld-2.23.so 0x7feba3417000-0x7feba3418000 /lib/x86_64-linux-gnu/ld-2.23.so 0x7feba3418000-0x7feba3419000 0x7fffa2ef9000-0x7fffa2f1a000 [stack] 0x7fffa2f50000-0x7fffa2f52000 [vvar] 0x7fffa2f52000-0x7fffa2f54000 [vdso] 0xffffffffff600000-0xffffffffff601000 [vsyscall] ==15206==End of process memory map. ==15206==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc:121 "(("unable to mmap" && 0)) != (0)" (0x0, 0x0) #0 0x7feba2324631 (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa0631) #1 0x7feba2329613 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xa5613) #2 0x7feba2331641 (/usr/lib/x86_64-linux-gnu/libasan.so.2+0xad641) #3 0x7feba22a6c0c (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x22c0c) #4 0x7feba22a7bf5 (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x23bf5) #5 0x7feba231c92f in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9892f) #6 0x7f42bd in fgetll /home/ubuntuadm/git/JtR/src/misc.c:181 #7 0x7d8424 in read_file /home/ubuntuadm/git/JtR/src/loader.c:198 #8 0x7db967 in ldr_load_pw_file /home/ubuntuadm/git/JtR/src/loader.c:1115 #9 0x7ce833 in john_load /home/ubuntuadm/git/JtR/src/john.c:1181 #10 0x7d0063 in john_init /home/ubuntuadm/git/JtR/src/john.c:1507 #11 0x7d1f2d in main /home/ubuntuadm/git/JtR/src/john.c:1967 #12 0x7feba0a2682f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #13 0x406338 in _start (/home/ubuntuadm/git/JtR/run/john+0x406338) ``` I'll try to split that huge `pwfile.agilekeychain` into smaller chunks, and process test cases of reasonable size, but that might take a while.
Author
Owner

@kholia commented on GitHub (Mar 8, 2017):

@frank-dittrich Is this bug a practical one which requires fixing? There has been no activity on this bug for a while. Can this bug be closed safely?

<!-- gh-comment-id:285047275 --> @kholia commented on GitHub (Mar 8, 2017): @frank-dittrich Is this bug a practical one which requires fixing? There has been no activity on this bug for a while. Can this bug be closed safely?
Author
Owner

@frank-dittrich commented on GitHub (Mar 8, 2017):

I think it needs fixing if it still exists.
I'll try to reproduce and get a small test case over the weekend.

<!-- gh-comment-id:285154375 --> @frank-dittrich commented on GitHub (Mar 8, 2017): I think it needs fixing if it still exists. I'll try to reproduce and get a small test case over the weekend.
Author
Owner

@magnumripper commented on GitHub (Dec 15, 2018):

Closing because it's a shame people love to fuzz but hate to help fixing bugs

<!-- gh-comment-id:447595811 --> @magnumripper commented on GitHub (Dec 15, 2018): Closing because it's a shame people love to fuzz but hate to help fixing bugs
Author
Owner

@roycewilliams commented on GitHub (Dec 15, 2018):

I see your point, but this doesn't feel right. Does it matter where the bug came from, if it's a real bug?

<!-- gh-comment-id:447596060 --> @roycewilliams commented on GitHub (Dec 15, 2018): I see your point, but this doesn't feel right. Does it matter where the bug came from, if it's a real bug?
Author
Owner

@ghost commented on GitHub (Dec 15, 2018):

I agree with magnum:

  • the issue is about a file pwfile.agilekeychain with fuzzed hashes;
  • does it really happens for a real file/hash?

And:

  • Low Priority - It have a tendency to become high priority if enough of the users complain.

  • WontFix - Covers all the reasons we chose to close the bug without taking action.

    • Nobody cares.
<!-- gh-comment-id:447600610 --> @ghost commented on GitHub (Dec 15, 2018): I agree with magnum: * the issue is about `a file pwfile.agilekeychain with fuzzed hashes`; * does it really happens for a real file/hash? And: * **Low Priority** - It have a tendency to become high priority if enough of the users complain. * **WontFix** - Covers all the reasons we chose to close the bug without taking action. * Nobody cares.
Author
Owner

@solardiz commented on GitHub (Dec 15, 2018):

If we only care about memory corruption from real-world usage and not from malicious files, we should very explicitly state so in the documentation, in some place like a text file called INSECURITY stating that JtR isn't to be used on untrusted input and should be run with the lowest privileges necessary (which is a good idea anyway). That's another task to take care of before the next release.

It's unfortunate that such a policy of ours (stemming from code complexity, lower than ideal quality, and lack of resources) is sort of incompatible with Kali's policy of running everything as root.

<!-- gh-comment-id:447601505 --> @solardiz commented on GitHub (Dec 15, 2018): If we only care about memory corruption from real-world usage and not from malicious files, we should very explicitly state so in the documentation, in some place like a text file called `INSECURITY` stating that JtR isn't to be used on untrusted input and should be run with the lowest privileges necessary (which is a good idea anyway). That's another task to take care of before the next release. It's unfortunate that such a policy of ours (stemming from code complexity, lower than ideal quality, and lack of resources) is sort of incompatible with Kali's policy of running everything as root.
Author
Owner

@roycewilliams commented on GitHub (Dec 15, 2018):

I see your (@claudioandre-br)'s point as well. I'm sure that many projects treat input hashes as trusted data, not just JtR.

But I also personally think that projects should think hard about that. As projects get more diverse, get called by other projects, provide APIs, get wrapped in web and database interfaces ... an entire class of future problems may be avoided by robustly handling unexpected hash input.

If bugs found by fuzzing are being closed as permanent WontFix - with no intention to ever return to them - I think that that may be unwise.

But maybe that's not what these closings mean. For example, maybe closing them means that they're effectively being moved to the bottom of the priority list. And if that's what closing it means, culturally, for JtR, that's of course understandable (and I'll remember that for future work :) )

[Note that I posted this before I saw @solardiz 's response]

<!-- gh-comment-id:447601546 --> @roycewilliams commented on GitHub (Dec 15, 2018): I see your (@claudioandre-br)'s point as well. I'm sure that many projects treat input hashes as trusted data, not just JtR. But I also personally think that projects should think hard about that. As projects get more diverse, get called by other projects, provide APIs, get wrapped in web and database interfaces ... an entire class of future problems may be avoided by robustly handling unexpected hash input. If bugs found by fuzzing are being closed as *permanent* WontFix - with no intention to ever return to them - I think that that may be unwise. But maybe that's not what these closings mean. For example, maybe closing them means that they're effectively being moved to the bottom of the priority list. And if that's what closing it means, culturally, for JtR, that's of course understandable (and I'll remember that for future work :) ) [Note that I posted this before I saw @solardiz 's response]
Author
Owner

@ghost commented on GitHub (Dec 15, 2018):

Royce and Solar, I'm afraid you both are not looking at the real problem.

Nobody cares to fix some formats. There are a lot of abandoned formats, and that is the real bug needing a solution.

  • Personally, I think we should mark these formats as FMT_IMMATURE and force users to use --format=desired-format.

Keep it open to pretend we are going to fix?

<!-- gh-comment-id:447602058 --> @ghost commented on GitHub (Dec 15, 2018): Royce and Solar, I'm afraid you both are not looking at the real problem. Nobody cares to fix some formats. There are a lot of abandoned formats, and that is the real bug needing a solution. * Personally, I think we should mark these formats as FMT_IMMATURE and force users to use `--format=desired-format`. *** Keep it open to pretend we are going to fix?
Author
Owner

@roycewilliams commented on GitHub (Dec 15, 2018):

I was indeed missing that context. I don't really mean to be defending this specific issue, since I don't really understand it. I was responding more to just the sentiment used at the point of closing this and one other issue, that seemed to be deprecating the value of fixing fuzzing-found bugs generally.

<!-- gh-comment-id:447602179 --> @roycewilliams commented on GitHub (Dec 15, 2018): I was indeed missing that context. I don't really mean to be defending this specific issue, since I don't really understand it. I was responding more to just the sentiment used at the point of closing this and one other issue, that seemed to be deprecating the value of fixing fuzzing-found bugs generally.
Author
Owner

@solardiz commented on GitHub (Dec 15, 2018):

I'm not saying we should re-open this issue. I'm saying we should document that we're not consistently finding and fixing (nor avoiding, which would have been even better) issues like this, so that there isn't a wrong expectation by the users. I am serious about adding this INSECURITY file. This was on my mental to-do for jumbo for years.

As to marking specific formats as known-problematic (and excluding them from auto-detection by default?), we can do that as well. But adding an INSECURITY file is probably more important as it "addresses" the general state of jumbo wrt untrusted input, which won't change if we merely fix a couple of known bugs or exclude a couple of known-problematic formats.

That said, the state of jumbo wrt untrusted input has probably improved from awful to poor since and in part due to the introduction of better built-in tests and fuzzer in 2015.

<!-- gh-comment-id:447602473 --> @solardiz commented on GitHub (Dec 15, 2018): I'm not saying we should re-open this issue. I'm saying we should document that we're not consistently finding and fixing (nor avoiding, which would have been even better) issues like this, so that there isn't a wrong expectation by the users. I am serious about adding this `INSECURITY` file. This was on my mental to-do for jumbo for years. As to marking specific formats as known-problematic (and excluding them from auto-detection by default?), we can do that as well. But adding an `INSECURITY` file is probably more important as it "addresses" the general state of jumbo wrt untrusted input, which won't change if we merely fix a couple of known bugs or exclude a couple of known-problematic formats. That said, the state of jumbo wrt untrusted input has probably improved from awful to poor since and in part due to the introduction of better built-in tests and fuzzer in 2015.
Author
Owner

@magnumripper commented on GitHub (Dec 16, 2018):

I'm fine with anything suggested here as long as you don't expect me to do it.

My main problem with this issue (and many similar, not sure how many are still open) is not that someone used a fuzzer per se - the problem is that the real hashes in most of the "fuzz bug" formats come from a something2john tool that is likely to get things right in terms of lengths, fields, formats and so on. Then Frank et al posts a gazillion bugs about what happens if you f@ck with those input strings. That just doesn't make sense as long as we're short on people. You could just as well fuzz the memory bus during a session and then post issues about John acting up. Right now there's only two persons likely to look at an issue like this one: @kholia and me. We have 27 open issues that are very much more likely to be real world bugs. Many of them are everything but trivial.

Besides, this is old. I wouldn't be surprised if it's fixed long ago (without anyone realizing it affected this issue). So before even documenting this, someone will have to reproduce the problem in the first place or we're producing worthless documentation, right?

So technically we could invent a new label "Re-verify" and hope that Frank does that - but I'm pretty sure he won't have time so it will be a W.O. anyway.

<!-- gh-comment-id:447606853 --> @magnumripper commented on GitHub (Dec 16, 2018): I'm fine with anything suggested here as long as you don't expect **me** to do it. My main problem with this issue (and many similar, not sure how many are still open) is **not** that someone used a fuzzer per se - the problem is that the real hashes in most of the "fuzz bug" formats come from a *something2john* tool that is likely to get things right in terms of lengths, fields, formats and so on. Then Frank et al posts a gazillion bugs about what happens if you f@ck with those input strings. That just doesn't make sense as long as we're short on people. You could just as well fuzz the memory bus during a session and then post issues about John acting up. Right now there's only two persons likely to look at an issue like this one: @kholia and me. We have 27 open issues that are very much **more** likely to be real world bugs. Many of them are everything but trivial. Besides, this is old. I wouldn't be surprised if it's fixed long ago (without anyone realizing it affected this issue). So before even documenting this, someone will have to reproduce the problem in the first place or we're producing worthless documentation, right? So technically we could invent a new label "Re-verify" and hope that Frank does that - but I'm pretty sure he won't have time so it will be a W.O. anyway.
Author
Owner

@solardiz commented on GitHub (Dec 16, 2018):

Not to argue, but I feel I need to explicitly mention that even if a bug is not triggerable when going through the normal "something2john" tool, it is nevertheless triggerable by malicious files that the user doesn't even intend to be of the "something" format (and hence would reasonably not run the extra tool on them first). So there's security impact here if jumbo's security when faced with untrusted input is reasonably expected, and "something2john" never producing such output doesn't fully eliminate that aspect.

<!-- gh-comment-id:447639546 --> @solardiz commented on GitHub (Dec 16, 2018): Not to argue, but I feel I need to explicitly mention that even if a bug is not triggerable when going through the normal "something2john" tool, it is nevertheless triggerable by malicious files that the user doesn't even intend to be of the "something" format (and hence would reasonably not run the extra tool on them first). So there's security impact here _if_ jumbo's security when faced with untrusted input is reasonably expected, and "something2john" never producing such output doesn't fully eliminate that aspect.
Author
Owner

@frank-dittrich commented on GitHub (Dec 17, 2018):

I've been fuzzing agilekeychain format now for more than 13 hours using afl (http://lcamtuf.coredump.cx/afl/).
So far, no crash found.
Then I checked the details of the call stack for this issue and for https://github.com/magnumripper/JohnTheRipper/issues/2003.
In both cases, the error occurs in line 105 of dyna_salt.c, i.e., the first dump_stuff_msg. (That code hasn't changed since 2016):

#ifdef DYNA_SALT_DEBUG
        dump_stuff_msg("salt_cmp\np1", _p1, comp_size>48?48:comp_size);
        dump_stuff_msg("p2", _p2, comp_size>48?48:comp_size);
#endif

So it looks like normal users shouldn't be affected, not even with malicious input files.

I'll see if I manage to trigger a crash with DYNA_SALT_DEBUG-

<!-- gh-comment-id:447833569 --> @frank-dittrich commented on GitHub (Dec 17, 2018): I've been fuzzing agilekeychain format now for more than 13 hours using afl (http://lcamtuf.coredump.cx/afl/). So far, no crash found. Then I checked the details of the call stack for this issue and for https://github.com/magnumripper/JohnTheRipper/issues/2003. In both cases, the error occurs in line 105 of dyna_salt.c, i.e., the first `dump_stuff_msg`. (That code hasn't changed since 2016): ``` #ifdef DYNA_SALT_DEBUG dump_stuff_msg("salt_cmp\np1", _p1, comp_size>48?48:comp_size); dump_stuff_msg("p2", _p2, comp_size>48?48:comp_size); #endif ``` So it looks like normal users shouldn't be affected, not even with malicious input files. I'll see if I manage to trigger a crash with DYNA_SALT_DEBUG-
bsakaguchi changed title from [GH-ISSUE #2005] ASan: heap-buffer-overflow for agilekeychain format when fuzzing to [GH-ISSUE #2005] ASan: heap-buffer-overflow for agilekeychain format when fuzzing 2026-10-15 04:15:02 +07:00
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#1347
No description provided.