Escaping and XSS

An XSS vulnerability allows a script to be injected into a page viewed by other users. The main defense is to escape data on output according to its context. Blade escapes by default with {{ }}; the {!! !!} syntax disables escaping and should only be used with trusted content.

Example

{{ $commentaire }}  {{-- escaped --}}

Related concepts

The whole glossary