Closed
Description
Symfony version(s) affected
6.2
Description
When you ask for input with QuestionHelper the input is truncated at 4096 byte.
The maximum line length in unix terminals is 4096. QuestionHelper additionally only reads the first 4096 byte of the input in:
How to reproduce
# Enter a very long string here
php bin/console secrets:set CERT_P12
protected function execute(InputInterface $input, OutputInterface $output): int
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
$io = new SymfonyStyle($input, $errOutput);
$value = $io->askHidden('Please type the secret value');
}
See:
The content of $value
is truncated to 4095 byte when you enter a text longer than that.
Possible Solution
Maybe a warning should be printed when an input has exactly 4095 characters to alert the user that there is the possibility that something was truncated.
Additional Context
Use case:
We use the Symfony CLI to set secrets (SecretsSetCommand, secret:set
). We have very long strings, like base64 encoded certificates in our secrets.