[GH-ISSUE #1164] --internal-encoding=CP437: asan error #727

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

Originally created by @loverszhaokai on GitHub (Mar 27, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1164

This bug is found by fuzzzing John using Fuzz Options.

There is the same error with --internal-encoding=CP1250
#1. Prepare

1.1 content of 7z_fmt

$7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b

1.2 compile with asan

$ export ASAN_OPTIONS='abort_on_error=1'
$ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure CC=gcc-4.9 --enable-asan && make -sj8

#2. Reproduce

$ ./john  --max-run-time=1  7z_fmt  --users=**  --internal-encoding=CP437

or 

$ ./john  --max-run-time=1  7z_fmt  --users=**  --internal-encoding=CP1250

ASAN:SIGSEGV
==121247==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000044 (pc 0x00000073c670 sp 0x7ffd8b81d3f0 bp 0x7ffd8b81d3f0 T0)
#0 0x73c66f in john_load_conf_db /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:871
#1 0x73d22d in john_load /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:973
#2 0x73e893 in john_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1241
#3 0x740504 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1674
#4 0x7f47258b7ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
#5 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:871 john_load_conf_db
==121247==ABORTING
Aborted
#3. Debug

At line 445 in file loader.c, it return 0 and NULL == *format, what should we do with a db_main whose format is NULL?

static int ldr_split_line(char **login, char **ciphertext,
    char **gecos, char **home, char **uid,
    char *source, struct fmt_main **format,
    struct db_options *db_opts, char *line)
{
    ...
445 if (ldr_check_list(db_opts->users, *login, *uid)) return 0;
    if (ldr_check_list(db_opts->groups, gid, gid)) return 0;
    if (ldr_check_shells(db_opts->shells, shell)) return 0;

    if (*format) {
    ...
    }

    ...
}
Originally created by @loverszhaokai on GitHub (Mar 27, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1164 This bug is found by fuzzzing John using Fuzz Options. There is the same error with --internal-encoding=**CP1250** #1. Prepare ## 1.1 content of 7z_fmt ``` $7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b ``` ## 1.2 compile with asan ``` shell $ export ASAN_OPTIONS='abort_on_error=1' $ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure CC=gcc-4.9 --enable-asan && make -sj8 ``` #2. Reproduce ``` shell $ ./john --max-run-time=1 7z_fmt --users=** --internal-encoding=CP437 or $ ./john --max-run-time=1 7z_fmt --users=** --internal-encoding=CP1250 ``` **ASAN:SIGSEGV** ==121247==**ERROR**: AddressSanitizer: SEGV on unknown address 0x000000000044 (pc 0x00000073c670 sp 0x7ffd8b81d3f0 bp 0x7ffd8b81d3f0 T0) #0 0x73c66f in john_load_conf_db /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:871 #1 0x73d22d in john_load /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:973 #2 0x73e893 in john_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1241 #3 0x740504 in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1674 #4 0x7f47258b7ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #5 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:871 john_load_conf_db ==121247==ABORTING Aborted #3. Debug At line **445** in file **loader.c**, it return 0 and NULL == *format, what should we do with a db_main whose format is NULL? ``` C static int ldr_split_line(char **login, char **ciphertext, char **gecos, char **home, char **uid, char *source, struct fmt_main **format, struct db_options *db_opts, char *line) { ... 445 if (ldr_check_list(db_opts->users, *login, *uid)) return 0; if (ldr_check_list(db_opts->groups, gid, gid)) return 0; if (ldr_check_shells(db_opts->shells, shell)) return 0; if (*format) { ... } ... } ```
bsakaguchi 2026-10-14 03:21:38 +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#727
No description provided.