[GH-ISSUE #1397] django_fmt: Segmentation fault #890

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

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

This bug is found by afl.
#1. Reproduce

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

$django$*1*pbkdf2_sha256$10000$qPmFbibfAY06$x/geVEkdZSlJMqvIYJ7G6i5l/6KJ0UpvLUU6cfj83VM=
$django$*1*pbkdf2_sha256$10000$*VmpZMBhRSd7$2nTDwPhSsDKOwpKiV04teVtf+a14Rs7na/lIB3KnHkM=
$django$*1*pbkdf2_sha256$10000$BVmpZMBhRSd1$bkdQo9RoatRomupPFP+XEo+Guuirq4mi+R1cFcV0U3M=
$django$*1*pbkdf2_sha256$10000$BVmpZMBhRSd6$Uq33DAHOFHUED+32IIqCqm+ITU1mhsGOJ7YwFf6h+6k=
$django$*1*pbkdf2_sha256$10000$34L3roCQ6ZfN$R21tJK1sIDfmj9BfBocefFfuGVwE3pXcLEhChNjc+pU=
$django$*1*pbkdf2_sha256$10000$7qPqyUDw8kZV$pFmVRjlHvayoWEy8ZWXkHgfmgImUKLmkmruclpYVAxM=

$ ./john pwfile

Segmentation fault

#2. GDB debug

Program received signal SIGSEGV, Segmentation fault.
__strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:68
68  ../sysdeps/x86_64/strcpy_chk.S: No such file or directory.
(gdb) bt
#0  __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:68
#1  0x00000000004d46df in strcpy (__src=<optimized out>, __dest=0xd8b2a8 <cs+8> "") at /usr/include/x86_64-linux-gnu/bits/string3.h:104
#2  get_salt (ciphertext=<optimized out>) at django_fmt_plug.c:170
#3  0x00000000005cdfa2 in ldr_load_pw_line (db=<optimized out>, line=<optimized out>) at loader.c:897
#4  0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000041,sig:11,src:000029,op:arith8,pos:120,val:-24", flags=<optimized out>,
    process_line=0x5cdae0 <ldr_load_pw_line>) at loader.c:135
#5  0x00000000005c9f5a in john_load () at john.c:1006
#6  0x00000000005ca7f5 in john_init (name=0x7fffffffec02 "john", argc=2, argv=0x7fffffffe968) at john.c:1290
#7  0x00000000005cb4e6 in main (argc=2, argv=0x7fffffffe968) at john.c:1730
Originally created by @loverszhaokai on GitHub (Jun 7, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1397 This bug is found by afl. #1. Reproduce $ ./configure && make -sj8 $ cat pwfile ``` $django$*1*pbkdf2_sha256$10000$qPmFbibfAY06$x/geVEkdZSlJMqvIYJ7G6i5l/6KJ0UpvLUU6cfj83VM= $django$*1*pbkdf2_sha256$10000$*VmpZMBhRSd7$2nTDwPhSsDKOwpKiV04teVtf+a14Rs7na/lIB3KnHkM= $django$*1*pbkdf2_sha256$10000$BVmpZMBhRSd1$bkdQo9RoatRomupPFP+XEo+Guuirq4mi+R1cFcV0U3M= $django$*1*pbkdf2_sha256$10000$BVmpZMBhRSd6$Uq33DAHOFHUED+32IIqCqm+ITU1mhsGOJ7YwFf6h+6k= $django$*1*pbkdf2_sha256$10000$34L3roCQ6ZfN$R21tJK1sIDfmj9BfBocefFfuGVwE3pXcLEhChNjc+pU= $django$*1*pbkdf2_sha256$10000$7qPqyUDw8kZV$pFmVRjlHvayoWEy8ZWXkHgfmgImUKLmkmruclpYVAxM= ``` $ ./john pwfile ``` C Segmentation fault ``` #2. GDB debug ``` C Program received signal SIGSEGV, Segmentation fault. __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:68 68 ../sysdeps/x86_64/strcpy_chk.S: No such file or directory. (gdb) bt #0 __strcpy_chk () at ../sysdeps/x86_64/strcpy_chk.S:68 #1 0x00000000004d46df in strcpy (__src=<optimized out>, __dest=0xd8b2a8 <cs+8> "") at /usr/include/x86_64-linux-gnu/bits/string3.h:104 #2 get_salt (ciphertext=<optimized out>) at django_fmt_plug.c:170 #3 0x00000000005cdfa2 in ldr_load_pw_line (db=<optimized out>, line=<optimized out>) at loader.c:897 #4 0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000041,sig:11,src:000029,op:arith8,pos:120,val:-24", flags=<optimized out>, process_line=0x5cdae0 <ldr_load_pw_line>) at loader.c:135 #5 0x00000000005c9f5a in john_load () at john.c:1006 #6 0x00000000005ca7f5 in john_init (name=0x7fffffffec02 "john", argc=2, argv=0x7fffffffe968) at john.c:1290 #7 0x00000000005cb4e6 in main (argc=2, argv=0x7fffffffe968) at john.c:1730 ```
bsakaguchi 2026-10-14 03:27:09 +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#890
No description provided.