Rendering Untrusted Content

Renders stored, authored, or imported content into HTML without shipping XSS — auditing every autoescape bypass (|safe, Markup, innerHTML), sanitizing Markdown output with an allowlist, escaping on both the server and the DOM, and writing sanitization tests that assert on the right copy of the string. Use when adding a Markdown or rich-text filter, rendering user/admin-authored content, reviewing a template that marks HTML trusted, building a client that injects values into innerHTML, or fixing an XSS report.

wdm0006 ec0b409 7.8 KB Updated

File contents

wdm0006/python-skills/tree/main/skills/common/rendering-untrusted-content commit ec0b4090e1

Frequently asked questions

npx skillmds@latest add wdm0006/rendering-untrusted-content