fix(security): sanitize newlines in health check commands to prevent RCE (#8898)
This commit is contained in:
commit
b817ed97c1
1 changed files with 3 additions and 2 deletions
|
|
@ -2777,9 +2777,10 @@ private function generate_healthcheck_commands()
|
||||||
{
|
{
|
||||||
// Handle CMD type healthcheck
|
// Handle CMD type healthcheck
|
||||||
if ($this->application->health_check_type === 'cmd' && ! empty($this->application->health_check_command)) {
|
if ($this->application->health_check_type === 'cmd' && ! empty($this->application->health_check_command)) {
|
||||||
$this->full_healthcheck_url = $this->application->health_check_command;
|
$command = str_replace(["\r\n", "\r", "\n"], ' ', $this->application->health_check_command);
|
||||||
|
$this->full_healthcheck_url = $command;
|
||||||
|
|
||||||
return $this->application->health_check_command;
|
return $command;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP type healthcheck (default)
|
// HTTP type healthcheck (default)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue