Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] infinite loop when excluding all symbols and strictly requiring symbols #48

Open
dillonstreator opened this issue Jul 6, 2020 · 3 comments · May be fixed by #49
Open

[Bug] infinite loop when excluding all symbols and strictly requiring symbols #48

dillonstreator opened this issue Jul 6, 2020 · 3 comments · May be fixed by #49

Comments

@dillonstreator
Copy link
Contributor

dillonstreator commented Jul 6, 2020

generate-password v1.5.1 currently has a bug which results in a max callstack size exceeded

The bug occurs when strictly requiring and then excluding those characters.

i.e.

import generator from 'generate-password';

generator.generate({
  strict: true,
  numbers: true,
  exclude: "1234567890",
});

Could we instead throw an error if the configuration is not possible?

@dillonstreator dillonstreator linked a pull request Jul 6, 2020 that will close this issue
@nemethyd
Copy link

nemethyd commented Jul 1, 2021

The same error happens with the following options:
{ length: 6,
numbers: true,
strict: true,
symbols: true,
exclude: ''
}

@khause
Copy link

khause commented Mar 2, 2022

I also got Maximum call stack size exceeded with the following configuration:

const symbols = '$*.[]{}()?\\-"!@#%&/\\,><^\':;|_~`+=';

{
  length: 32,
  lowercase: true,
  numbers: true,
  strict: true,
  symbols,
  uppercase: true,
}

I fixed it by escaping ] to be \\] so the full string of symbols will be:

$*.[\\]{}()?\\-"!@#%&/\\,><^\':;|_~\`+=

It seems like any misconfiguration throws this error.

@nemethyd
Copy link

nemethyd commented Mar 3, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants