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

gui login throws unhandled exception when password argument does not match length of hashed gui password #20

Open
chrypnotoad opened this issue Aug 20, 2024 · 0 comments

Comments

@chrypnotoad
Copy link
Contributor

chrypnotoad commented Aug 20, 2024

  • sending any input that does not match the length of the hashed password will cause the exception
  • operator-cli gui login is currently only used by the gui which sends the hashed password.
  • the --help text for this should be updated to indicate it expects a hashed password

!timingSafeEqual(Buffer.from(password), Buffer.from(config.gui.pass))

$ operator-cli gui login a                                                               
/home/node/app/cli/build/src/gui-commands.js:154
        if (!(0, crypto_1.timingSafeEqual)(Buffer.from(password), Buffer.from(config.gui.pass))) {
                                          ^

RangeError: Input buffers must have the same byte length
    at Command.<anonymous> (/home/node/app/cli/build/src/gui-commands.js:154:43)
    at Command.listener [as _actionHandler] (/home/node/app/cli/node_modules/commander/lib/command.js:482:17)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/home/node/app/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/home/node/app/cli/node_modules/commander/lib/command.js:1283:27)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1081:27
    at Command._chainOrCall (/home/node/app/cli/node_modules/commander/lib/command.js:1177:12)
    at Command._dispatchSubcommand (/home/node/app/cli/node_modules/commander/lib/command.js:1077:23)
    at Command._parseCommand (/home/node/app/cli/node_modules/commander/lib/command.js:1248:19)
    at /home/node/app/cli/node_modules/commander/lib/command.js:1081:27 {
  code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH'
}

Node.js v18.16.1
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

No branches or pull requests

1 participant