Skip to content

Commit 467396f

Browse files
[PasswordHasher] Add warning to UserPasswordHashCommand when passing plain password as argument
1 parent 33f2502 commit 467396f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Command/UserPasswordHashCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
101101
$input->isInteractive() ? $errorIo->title('Symfony Password Hash Utility') : $errorIo->newLine();
102102

103103
$password = $input->getArgument('password');
104+
105+
if ($password) {
106+
$errorIo->warning('Using a password as a command argument is insecure. Use the interactive mode instead.');
107+
}
108+
104109
$userClass = $this->getUserClass($input, $io);
105110
$emptySalt = $input->getOption('empty-salt');
106111

0 commit comments

Comments
 (0)