[GH-ISSUE #1987] ASan error in axcrypt format #1330

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

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

$ ./john --test=0 --format=axcrypt 
Will run 8 OpenMP threads
Testing: axcrypt, AxCrypt [SHA1 AES 32/64]... (8xOMP) =================================================================
==10879==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000e53f68 at pc 0x7f68a09ebd55 bp 0x7fffd439ad60 sp 0x7fffd439a508
READ of size 72 at 0x000000e53f68 thread T0
    #0 0x7f68a09ebd54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54)
    #1 0x78c4c9 in mem_alloc_copy_func /home/fd/git/JtR/src/memory.c:241
    #2 0x773ee1 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:929
    #3 0x7782a0 in ldr_init_test_db /home/fd/git/JtR/src/loader.c:1099
    #4 0x74486b in benchmark_all /home/fd/git/JtR/src/bench.c:684
    #5 0x76d372 in john_run /home/fd/git/JtR/src/john.c:1587
    #6 0x76eaef in main /home/fd/git/JtR/src/john.c:1973
    #7 0x7f689ed3b6ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #8 0x4068b8 in _start (/home/fd/git/JtR/run/john+0x4068b8)

0x000000e53f68 is located 56 bytes to the left of global variable 'cs' defined in 'axcrypt_fmt_plug.c:155:28' (0xe53fa0) of size 72
0x000000e53f68 is located 0 bytes to the right of global variable 'ptr' defined in 'axcrypt_fmt_plug.c:156:15' (0xe53f60) of size 8
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
  0x0000801c2790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801c27a0: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801c27b0: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801c27c0: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9
  0x0000801c27d0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
=>0x0000801c27e0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00[f9]f9 f9
  0x0000801c27f0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 f9 f9 f9
  0x0000801c2800: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x0000801c2810: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0000801c2820: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801c2830: 00 00 00 00 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
==10879==ABORTING
 $ ./john --list=build-info 
Version: 1.8.0.6-jumbo-1-1840-g51d4996
Build: linux-gnu 64-bit AVX-ac OMP ASan
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)

To reproduce, just build with ASan support (libasan needs to be installed)

$ make -s distclean; ./configure --enable-asan && make -s clean && make -s -j 8
Originally created by @frank-dittrich on GitHub (Jan 11, 2016). Original GitHub issue: https://github.com/openwall/john/issues/1987 ``` $ ./john --test=0 --format=axcrypt Will run 8 OpenMP threads Testing: axcrypt, AxCrypt [SHA1 AES 32/64]... (8xOMP) ================================================================= ==10879==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000e53f68 at pc 0x7f68a09ebd55 bp 0x7fffd439ad60 sp 0x7fffd439a508 READ of size 72 at 0x000000e53f68 thread T0 #0 0x7f68a09ebd54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54) #1 0x78c4c9 in mem_alloc_copy_func /home/fd/git/JtR/src/memory.c:241 #2 0x773ee1 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:929 #3 0x7782a0 in ldr_init_test_db /home/fd/git/JtR/src/loader.c:1099 #4 0x74486b in benchmark_all /home/fd/git/JtR/src/bench.c:684 #5 0x76d372 in john_run /home/fd/git/JtR/src/john.c:1587 #6 0x76eaef in main /home/fd/git/JtR/src/john.c:1973 #7 0x7f689ed3b6ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #8 0x4068b8 in _start (/home/fd/git/JtR/run/john+0x4068b8) 0x000000e53f68 is located 56 bytes to the left of global variable 'cs' defined in 'axcrypt_fmt_plug.c:155:28' (0xe53fa0) of size 72 0x000000e53f68 is located 0 bytes to the right of global variable 'ptr' defined in 'axcrypt_fmt_plug.c:156:15' (0xe53f60) of size 8 SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy Shadow bytes around the buggy address: 0x0000801c2790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801c27a0: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801c27b0: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801c27c0: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9 0x0000801c27d0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 =>0x0000801c27e0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00[f9]f9 f9 0x0000801c27f0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 f9 f9 f9 0x0000801c2800: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 0x0000801c2810: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 0x0000801c2820: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000801c2830: 00 00 00 00 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 ==10879==ABORTING ``` ``` $ ./john --list=build-info Version: 1.8.0.6-jumbo-1-1840-g51d4996 Build: linux-gnu 64-bit AVX-ac OMP ASan 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) ``` To reproduce, just build with ASan support (libasan needs to be installed) ``` $ make -s distclean; ./configure --enable-asan && make -s clean && make -s -j 8 ```
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#1330
No description provided.