fix(health-checks): sanitize and validate CMD healthcheck commands

- Add regex validation to restrict allowed characters (alphanumeric, spaces, and specific safe symbols)
- Enforce maximum 1000 character limit on healthcheck commands
- Strip newlines and carriage returns to prevent command injection
- Change input field from textarea to text input in UI
- Add warning callout about prohibited shell operators
- Add comprehensive validation tests for both valid and malicious command patterns
This commit is contained in:
Andras Bacsai committed 2026-02-25 11:28:33 +01:00
1 parent 65d4005493
commit 609cb4190e
5 files changed
+160 -7

No files matched your search

+3 -2
View File
@@ -2758,9 +2758,10 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
{
// Handle CMD type healthcheck
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)