PHP-071 / Advanced
Stored XSS in Markdown or HTML input (missing sanitization)
Why is this a problem?
If a Markdown converter passes raw HTML through, an element such as <img onerror=...> can be stored and executed.
How to fix it
php
return Str::markdown($post->body, ['html_input' => 'escape', 'allow_unsafe_links' => false]);
// Alternatively allowlist tags using HTMLPurifier or similar