Lingadzi House, City Centre, Lilongwe, Malawi
Mon - Fri : 07.30 AM - 16.30 PM
+265 (0)101 771 111
USAID/Malawi-funded Protecting Ecosystems and Restoring Forests in Malawi Project [PERFORM ]
USAID/Malawi-funded Protecting Ecosystems and Restoring Forests in Malawi Project [PERFORM ]

By default, the editor outputs raw Markdown and HTML, and sends it to the backend. Attackers are able to intercept the value of the component and send a different raw HTML string to the backend. As such, it is important that when outputting the HTML from a Markdown editor, it is sanitized; otherwise your site may be exposed to Cross-Site Scripting (XSS) vulnerabilities. 

When Filament outputs raw HTML from the database in components such as TextColumn and TextEntry, it sanitizes it to remove any dangerous JavaScript. However, if you are outputting the HTML from a Markdown editor in your own Blade view, this is your responsibility. 

Dashboard.png 87.82 KB

One option is to use Filament's sanitizeHtml() helper to do this, which is the same tool we use to sanitize HTML in the components mentioned above: