[GH-ISSUE #1396] SKEY_fmt: Segmentation fault #888

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

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

This bug is found by afl.
#1. Reproduce

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

$o5logon$��56649330E846*00A1)27159E756D41AFA55$488D82FA7C8A418E5���B40*2C0DC404A8>5D0CD1EF78�6EC3I74A5C1D7D43F$,=EBB$1A�:1DB06EBC1D7742d$o5logyn$,=EBB$1A�7:1DBB5FFCCC87E3@D��DF5AJ9FA74FC85F367�5D4
16 A909F85>374F16FD2711EFB59�c75b7c1F7A55$7E3@D29DF5A>9FA747C=��C1837F750E06EBC1D7742BC6
$o5D1EF78�6EC 7A04000F3o5loLon0A65D9C54C9C01A090CB9"E954A5836C95D
$o5�n�������77117E805F36695D4
16 A90982F2D6D019C6
$o5D1EF78�6EC 7A04000F3o756Dt1AF7A55$488D8*3D14D545x0BC3E511F4
$o54527A5516F0A4B1BE1126A062o5D1EF78�6EC 7AA;9F0D3268821EF361BF0F392B782F2D6D0192FD6*3D14D54520BC9E6511F4

$ ./john pwfile

Warning: invalid UTF-8 seen reading out/crashes/id:000039,sig:11,src:000027,op:havoc,rep:128
Segmentation fault

#2. GDB debug

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00000000004b3f95 in hex_decode (outsize=8, dst=0x12d5fe0 "", src=0x0) at SKEY_fmt_plug.c:141
#2  get_binary (ciphertext=<optimized out>) at SKEY_fmt_plug.c:211
#3  0x00000000005cdbc8 in ldr_load_pw_line (db=<optimized out>, line=<optimized out>) at loader.c:840
#4  0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000039,sig:11,src:000027,op:havoc,rep:128", 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=0x7fffffffec0b "john", argc=2, argv=0x7fffffffe978) at john.c:1290
#7  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/1396 This bug is found by afl. #1. Reproduce $ ./configure && make -sj8 $ cat pwfile ``` $o5logon$��56649330E846*00A1)27159E756D41AFA55$488D82FA7C8A418E5���B40*2C0DC404A8>5D0CD1EF78�6EC3I74A5C1D7D43F$,=EBB$1A�:1DB06EBC1D7742d$o5logyn$,=EBB$1A�7:1DBB5FFCCC87E3@D��DF5AJ9FA74FC85F367�5D4 16 A909F85>374F16FD2711EFB59�c75b7c1F7A55$7E3@D29DF5A>9FA747C=��C1837F750E06EBC1D7742BC6 $o5D1EF78�6EC 7A04000F3o5loLon0A65D9C54C9C01A090CB9"E954A5836C95D $o5�n�������77117E805F36695D4 16 A90982F2D6D019C6 $o5D1EF78�6EC 7A04000F3o756Dt1AF7A55$488D8*3D14D545x0BC3E511F4 $o54527A5516F0A4B1BE1126A062o5D1EF78�6EC 7AA;9F0D3268821EF361BF0F392B782F2D6D0192FD6*3D14D54520BC9E6511F4 ``` $ ./john pwfile ``` C Warning: invalid UTF-8 seen reading out/crashes/id:000039,sig:11,src:000027,op:havoc,rep:128 Segmentation fault ``` #2. GDB debug ``` C Program received signal SIGSEGV, Segmentation fault. strlen () at ../sysdeps/x86_64/strlen.S:106 106 ../sysdeps/x86_64/strlen.S: No such file or directory. (gdb) bt #0 strlen () at ../sysdeps/x86_64/strlen.S:106 #1 0x00000000004b3f95 in hex_decode (outsize=8, dst=0x12d5fe0 "", src=0x0) at SKEY_fmt_plug.c:141 #2 get_binary (ciphertext=<optimized out>) at SKEY_fmt_plug.c:211 #3 0x00000000005cdbc8 in ldr_load_pw_line (db=<optimized out>, line=<optimized out>) at loader.c:840 #4 0x00000000005cbba1 in read_file (db=0xfac1c0 <database>, name=0x10ca118 "out/crashes/id:000039,sig:11,src:000027,op:havoc,rep:128", 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=0x7fffffffec0b "john", argc=2, argv=0x7fffffffe978) at john.c:1290 #7 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

@frank-dittrich commented on GitHub (Jun 23, 2015):

./john --format=skey also crashes on simpler input files without any non-ascii characters:

00 b519dcfe18eb7aab

(I guess this is similar to the 16 A90982F2D6D019C6 line in the pwfile mentioned above.)

0096 luky4:1004  b519dcfe18eb7aab
<!-- gh-comment-id:114423375 --> @frank-dittrich commented on GitHub (Jun 23, 2015): `./john --format=skey` also crashes on simpler input files without any non-ascii characters: ``` 00 b519dcfe18eb7aab ``` (I guess this is similar to the `16 A90982F2D6D019C6` line in the pwfile mentioned above.) ``` 0096 luky4:1004 b519dcfe18eb7aab ```
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#888
No description provided.