You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the bug is happening because the picocli interactive mode for password reading is using the Console.readPassword() function. This functions seems to only support reading up to 1024 characters. If you copy-paste a string with more than 1024 characters the excess characters get truncated. The problem now is that the readPassword method cannot process the next char which would be the newLine character to confirm the password. You can verify this by deleting the last character in the interactive mode via backspace and then pressing Enter which should work.
This problem can be tracked back to the tty driver’s internal buffer which seems to be capped at 1024 characters for OS X.
Suggested solution:
I think the best and more secure practice to read longer passwords should be to provide a functionality which lets me read the password from a file or via an environment variable as suggested in a picocli example:
Expected behavior
Client connects with password set to a long value.
Actual behavior
CLI becomes unresponsive and needs to be terminated with CTRL+C.
To Reproduce
Steps
Enter long password, e.g. a JWT.
Reproducer code
No code.
Details
1.0.1
Picocli 4.0.4
JVM: 11.0.4 (AdoptOpenJDK OpenJDK 64-Bit Server VM 11.0.4+11)
OS: Mac OS X 10.15 x86_64
The text was updated successfully, but these errors were encountered: