I have a form for users who want to add new content on my Drupal 8 website. I render node field on a twig template :
{{ node_field_title.value }}
But field are not sanitized by Drupal. Is it the normal behaviour ?
--> If the title is <script>alert('XSS problem!')</script>
the script will be executed.
Drupal 8 documentation says : 'The Twig theme engine now auto escapes everything by default. That means that every string printed from a Twig template (e.g. anything between {{ }}) gets automatically sanitized if no filters are used.'
<script>alert('XSS problem')</script>
. The script is exexcuted and if i click on 'OK' to close the alert windows, i can see the script written on the page.|raw
. Not a good idea.. Thank you for your help !