CVE-2024-34697: Laravel Sanitize Rendered View

Sanitizing a fully rendered view bypasses the sanitization process for dynamic variables. Blade templates automatically HTML-encode variables (e.g. converting `<script>` to `&lt;script&gt;`). Consequently, passing the rendered view to functions like `strip_tags` or `stripDangerousTags` will fail to remove these encoded, malicious tags. If the view output is

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0PHP
greprules fetch cve-2024-34697-laravel-sanitize-rendered-view --engine opengrep

Description

Sanitizing a fully rendered view bypasses the sanitization process for dynamic variables. Blade templates automatically HTML-encode variables (e.g. converting `<script>` to `&lt;script&gt;`). Consequently, passing the rendered view to functions like `strip_tags` or `stripDangerousTags` will fail to remove these encoded, malicious tags. If the view output is