In this activity, you will prevent Context-Aware XSS by validating URLs.
<a href="{url}">.
javascript:alert(1). When anyone clicks their profile link, the script executes!
Modify the sanitize_link function:
http:// or https://."#".html.escape() to prevent "quote breaking" attacks (e.g., https://x.com" onclick="alert(1)).html.escape() alone is not enough here. A malicious JavaScript URL is valid HTML text, but dangerous when used in an href context. You must allowlist the protocol first.