Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-47186 Overview
CVE-2024-47186 is a cross-site scripting (XSS) vulnerability in Filament, a collection of full-stack components for Laravel development. The flaw affects versions v3.0.0 through v3.2.114 and resides in how ColorColumn and ColorEntry components render user-supplied values. When invalid state values containing specific characters are passed into these components, the output is injected into an inline style attribute without proper escaping. An attacker can craft input that breaks out of the CSS context and executes arbitrary script in the browser of any user who views a page rendering the vulnerable column or entry. The maintainers released a fix in Filament v3.2.115 (GHSA-9h9q-qhxg-89xr).
Critical Impact
Stored or reflected XSS executes in the context of authenticated Laravel admin users viewing pages that render color columns or entries, enabling session abuse and administrative action hijacking.
Affected Products
- Filament v3.0.0 through v3.2.114
- filamentphp/filament Laravel package (Infolists ColorEntry component)
- filamentphp/filament Laravel package (Tables ColorColumn component)
Discovery Timeline
- 2024-09-27 - CVE CVE-2024-47186 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-47186
Vulnerability Analysis
The vulnerability is an improper neutralization of input during web page generation [CWE-79]. Filament's ColorColumn and ColorEntry Blade templates interpolate the component's $state value directly into an inline CSS background-color declaration. Because the state is embedded in a style attribute via Blade string interpolation rather than through Laravel's e() escape helper, HTML metacharacters such as " and > can terminate the attribute and inject new HTML or event handlers. Exploitation requires an attacker to control a value that is persisted and later rendered within a color column or entry. User interaction is required, as a victim must load the page containing the affected component.
Root Cause
The root cause is unescaped output in the Blade view files packages/infolists/resources/views/components/color-entry.blade.php and packages/tables/resources/views/columns/color-column.blade.php. Both templates built the style string as "background-color: {$state}", trusting the $state variable to contain only a valid color literal. No HTML or CSS context escaping was applied, allowing script-equivalent payloads when $state originated from attacker-controlled data stored in the database.
Attack Vector
An attacker with the ability to write to a model field surfaced by a ColorColumn or ColorEntry submits a crafted non-color value. When an administrator loads a Filament table or infolist that renders that field, the browser parses the injected markup and executes the attacker's script in the admin's session context. The attack is network-reachable, requires no privileges on the application, and depends on a victim loading the affected view.
// Patch applied in Filament v3.2.115 (color-entry.blade.php and color-column.blade.php)
'cursor-pointer' => $itemIsCopyable,
])
@style([
- "background-color: {$state}" => $state,
+ 'background-color: ' . e($state) => $state,
])
></div>
@endforeach
Source: filamentphp/filament commit df79893. The fix wraps $state with Laravel's e() helper, HTML-encoding characters that would otherwise break out of the inline style attribute.
Detection Methods for CVE-2024-47186
Indicators of Compromise
- Database records bound to ColorColumn or ColorEntry fields that contain characters such as ", <, >, or on event-handler fragments instead of valid CSS color literals.
- Server access logs showing POST or PATCH requests to Filament resource endpoints with payloads that include HTML or JavaScript tokens in color-related fields.
- Browser-side errors or Content Security Policy (CSP) violation reports originating from Filament admin pages that render color columns.
Detection Strategies
- Perform a static scan of the application repository for Filament versions below 3.2.115 in composer.lock.
- Query affected tables for rows where color-typed fields do not match a strict regex such as ^#(?:[0-9a-fA-F]{3}){1,2}$ or recognized rgb(...) and named-color patterns.
- Review Laravel application and web server logs for suspicious inputs targeting endpoints that persist color values.
Monitoring Recommendations
- Enable and monitor CSP violation reporting on Filament admin routes to surface attempted script execution.
- Alert on administrative sessions that trigger unexpected outbound requests shortly after loading pages containing color columns or entries.
- Track changes to composer.lock in CI to ensure the Filament version remains at or above the patched release.
How to Mitigate CVE-2024-47186
Immediate Actions Required
- Upgrade filamentphp/filament to v3.2.115 or later across all environments.
- Audit database fields rendered by ColorColumn and ColorEntry and sanitize any stored values that are not valid CSS colors.
- Rotate administrative session cookies and credentials if logs indicate exposure to crafted color values prior to patching.
Patch Information
The fix is delivered in Filament v3.2.115 via commit df7989352464d08eda5837ef50f9997fad902316, which replaces the raw {$state} interpolation with Laravel's e($state) escaping helper in both the infolist and table color components. See the GitHub release notes for v3.2.115 and GHSA-9h9q-qhxg-89xr for complete advisory details.
Workarounds
- Add server-side validation on all model attributes bound to ColorColumn or ColorEntry so that only strict color literals are accepted.
- Temporarily override the affected Blade views to wrap $state with the e() helper until the package upgrade is deployed.
- Deploy a restrictive Content Security Policy that disallows inline event handlers and untrusted script sources on Filament admin routes.
# Upgrade Filament to the patched release
composer require filament/filament:^3.2.115 --update-with-dependencies
php artisan view:clear
php artisan config:clear
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

