Twig icon indicating copy to clipboard operation
Twig copied to clipboard

add json extension to FileExtensionEscapingStrategy (security)

Open devkral opened this issue 3 years ago • 0 comments

why

people tend to forget that the default escape guessing strategy doesn't apply the correct escape filter to json.twig.

This causes a huge security hole in such projects because the default filter html allows too much.

what

add to FileExtensionEscapingStrategy.php

...
            case 'json':
                return 'js';
...

devkral avatar Mar 04 '22 11:03 devkral