[GH-ISSUE #1385] django-scrypt: Floating point exception 2 #877

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

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

This bug is found by fuzz.pl written by solar.
#1. Reproduce

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

scrypt$NBGmaGIXijJW$14$81$$64$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA==
scrypt$NBGmaGIXijJW$14$8$$164$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA==
scrypt$Cj0PzdtT3qS2$14$81$$64$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA==
scrypt$Cj0PzdtT3qS2$14$8$$164$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA==
scrypt$NBGmaGIXijJW$14$81$$64$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA==
scrypt$NBGmaGIXijJW$14$8$$164$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA==
scrypt$Cj0PzdtT3qS2$14$81$$64$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA==
scrypt$Cj0PzdtT3qS2$14$8$$164$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA==

$ ./john pwfile

Using default input encoding: UTF-8
Loaded 8 password hashes with 4 different salts (django-scrypt [Salsa20/8 128/128 AVX])
Loaded hashes with cost 2 (r) varying from 8 to 81
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Floating point exception

#2. GDB debug

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7ffff131f700 (LWP 85007)]
0x0000000000425377 in escrypt_kdf (local=0x7ffff131ed80, passwd=0x0, passwd@entry=0x12ebba2 "abc123", passwdlen=0, passwdlen@entry=6, salt=0x12d603c "NBGmaGIXijJW",
    saltlen=0, saltlen@entry=12, N=16384, r=81, p=0, buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-sse.c:336
336     if ((r > SIZE_MAX / 128 / p) ||
(gdb) bt
#0  0x0000000000425377 in escrypt_kdf (local=0x7ffff131ed80, passwd=0x0, passwd@entry=0x12ebba2 "abc123", passwdlen=0, passwdlen@entry=6, salt=0x12d603c "NBGmaGIXijJW",
    saltlen=0, saltlen@entry=12, N=16384, r=81, p=0, buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-sse.c:336
#1  0x00000000004261d4 in crypto_scrypt (passwd=0x12ebba2 "abc123", passwdlen=6, salt=salt@entry=0x12d603c "NBGmaGIXijJW", saltlen=saltlen@entry=12, N=16384, r=81, p=0,
    buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-common.c:252
#2  0x00000000004d588e in crypt_all._omp_fn.0 () at django_scrypt_fmt_plug.c:199
#3  0x00007ffff6c22826 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#4  0x00007ffff69ff182 in start_thread (arg=0x7ffff131f700) at pthread_create.c:312
#5  0x00007ffff672c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Originally created by @loverszhaokai on GitHub (Jun 6, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1385 This bug is found by fuzz.pl written by solar. #1. Reproduce $ ./configure && make -sj8 $ cat pwfile ``` scrypt$NBGmaGIXijJW$14$81$$64$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA== scrypt$NBGmaGIXijJW$14$8$$164$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA== scrypt$Cj0PzdtT3qS2$14$81$$64$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA== scrypt$Cj0PzdtT3qS2$14$8$$164$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA== scrypt$NBGmaGIXijJW$14$81$$64$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA== scrypt$NBGmaGIXijJW$14$8$$164$achPt01SbytSt+F3CcCFgEPr96+/j9iCTdejFdAARZ8mzfejrP64TJ5XBJa3gYwuCKOEGlw2E/lWCWS7LeS6CA== scrypt$Cj0PzdtT3qS2$14$81$$64$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA== scrypt$Cj0PzdtT3qS2$14$8$$164$qn4CDnM8CcIBNrpQXHo6ti8vSUoSXj7GBFy7k1bp5wPs8jKjh/gHZ+qM9uk6LbcVHm02yBaI5WCbDm/Shq/MXA== ``` $ ./john pwfile ``` Using default input encoding: UTF-8 Loaded 8 password hashes with 4 different salts (django-scrypt [Salsa20/8 128/128 AVX]) Loaded hashes with cost 2 (r) varying from 8 to 81 Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status Floating point exception ``` #2. GDB debug ``` C Program received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7ffff131f700 (LWP 85007)] 0x0000000000425377 in escrypt_kdf (local=0x7ffff131ed80, passwd=0x0, passwd@entry=0x12ebba2 "abc123", passwdlen=0, passwdlen@entry=6, salt=0x12d603c "NBGmaGIXijJW", saltlen=0, saltlen@entry=12, N=16384, r=81, p=0, buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-sse.c:336 336 if ((r > SIZE_MAX / 128 / p) || (gdb) bt #0 0x0000000000425377 in escrypt_kdf (local=0x7ffff131ed80, passwd=0x0, passwd@entry=0x12ebba2 "abc123", passwdlen=0, passwdlen@entry=6, salt=0x12d603c "NBGmaGIXijJW", saltlen=0, saltlen@entry=12, N=16384, r=81, p=0, buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-sse.c:336 #1 0x00000000004261d4 in crypto_scrypt (passwd=0x12ebba2 "abc123", passwdlen=6, salt=salt@entry=0x12d603c "NBGmaGIXijJW", saltlen=saltlen@entry=12, N=16384, r=81, p=0, buf=0x12ebdf0 "", buflen=64) at escrypt/crypto_scrypt-common.c:252 #2 0x00000000004d588e in crypt_all._omp_fn.0 () at django_scrypt_fmt_plug.c:199 #3 0x00007ffff6c22826 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1 #4 0x00007ffff69ff182 in start_thread (arg=0x7ffff131f700) at pthread_create.c:312 #5 0x00007ffff672c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 ```
bsakaguchi 2026-10-14 03:26:58 +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#877
No description provided.