GithubHelp home page GithubHelp logo

cryptosense / ocaml-zxcvbn Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 1.0 1.51 MB

Ocaml bindings for the zxcvbn password strength estimation library

License: Other

OCaml 79.22% C 20.78%
ocaml zxcvbn password-strength bindings

ocaml-zxcvbn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

khady

ocaml-zxcvbn's Issues

Memory corruption

The following piece of code generates errors in valgrind:

let random_char () =
  Char.chr (1 + Random.int 126)

let random_pass () =
  String.init 10 (fun _ -> random_char ())

let check_random_pass () =
  let s = random_pass () in
  let (guesses, _) = Zxcvbn.matches s in
  Printf.printf "%S: %f\n%!" s guesses

let () =
  while true do
    check_random_pass ()
  done

(I can send you a PR with that as a test ~exec:false executable if you'd like)

More precisely:

Invalid read of size 1
   at 0x18455E: ZxcvbnMatch (zxcvbn.c:1635)
   by 0x1829BD: zxcvbn_match_caml (zxcvbn_stubs.c:60)
   by 0x142153: camlFuzz__check_random_pass_1203 (fuzz.ml:9)
   by 0x1421D6: camlFuzz__entry (fuzz.ml:14)
   by 0x13F838: caml_program
   by 0x19D853: ???
   by 0x19DBD4: caml_main (startup.c:145)
   by 0x13F4CB: main (main.c:37)
 Address 0x5f9434b is 0 bytes after a block of size 11 alloc'd
   at 0x4C2BBEF: malloc (vg_replace_malloc.c:299)
   by 0x184442: ZxcvbnMatch (zxcvbn.c:1604)
   by 0x1829BD: zxcvbn_match_caml (zxcvbn_stubs.c:60)
   by 0x142153: camlFuzz__check_random_pass_1203 (fuzz.ml:9)
   by 0x1421D6: camlFuzz__entry (fuzz.ml:14)
   by 0x13F838: caml_program
   by 0x19D853: ???
   by 0x19DBD4: caml_main (startup.c:145)
   by 0x13F4CB: main (main.c:37)

This seems to be fixed in recent versions of zxcvbn-c, since upgrading to master solves this problem.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.