mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-05 12:22:57 +00:00
fix: sanitize error output in server validation logs
Escape dynamic error messages with htmlspecialchars() before concatenating into HTML strings stored in validation_logs. Add a Purify-based mutator on Server model as defense-in-depth, with a dedicated HTMLPurifier config that allows only safe structural tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e39678aea5
commit
103d5b6c06
@@ -269,6 +269,13 @@ class Server extends BaseModel
|
||||
|
||||
use HasSafeStringAttribute;
|
||||
|
||||
public function setValidationLogsAttribute($value): void
|
||||
{
|
||||
$this->attributes['validation_logs'] = $value !== null
|
||||
? \Stevebauman\Purify\Facades\Purify::config('validation_logs')->clean($value)
|
||||
: null;
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return 'server';
|
||||
|
||||
Reference in New Issue
Block a user