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.
Install
/plugin marketplace add wdm0006/python-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add wdm0006/python-skills --skill rendering-untrusted-contentgit clone --depth 1 https://github.com/wdm0006/python-skills.git /tmp/python-skills
mkdir -p ~/.claude/skills
cp -r /tmp/python-skills/skills/common/rendering-untrusted-content ~/.claude/skills/rendering-untrusted-contentPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Rendering Untrusted Content
Template engines autoescape by default, so the vulnerable surface is small and
enumerable: it is exactly the places where something says *this value is already
safe HTML*. Find those first; everything else is already handled.
## Step 1 — Enumerate the trust bypasses
```bash
# Server-side (Jinja/Django templates + the Python that feeds them)
grep -rnE '\|\s*safe|Markup\(|autoescape false|mark_safe' templates/ src/
# Client-side
grep -rnE 'innerHTML|outerHTML|insertAdjacentHTML|document\.write' web/ static/
```
Every hit is a claim that needs justification. A `|safe` on a value that came from
a database column is a claim about *everything that has ever been written to that
column*, including via an import path nobody remembers.
## Step 2 — Markdown output is not sanitized HTML
Markdown renderers pass raw HTML through **by design** — that is a documented
feature, not a bug. So a shared template filter shaped like this is an XSS sink:
```python
# BAD — the filter marks arbitrary stored markup trusted.
def _markdown(text: str) -> Markup:
return Markup(markdown.markdown(text, extensions=["extra", "tables"]))
```
"Only admins author content" is not a boundary. As soon as there is an import
path, a seed script, or a second author, the content store is untrusted input.
Render, then sanitize with an **allowlist**, and only then mark trusted:Details
- Skill name
rendering-untrusted-content- Repository
- wdm0006/python-skills
- Path
skills/common/rendering-untrusted-content/SKILL.md- License
- MIT
- Repo updated
- 18 November 2026
FAQ
What does the Rendering Untrusted Content skill do?
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.
How do I install the Rendering Untrusted Content skill?
Claude Code plugin: /plugin marketplace add wdm0006/python-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Rendering Untrusted Content popular?
It lives in wdm0006/python-skills, which has 115 GitHub stars and 18 forks.
Related skills
Auditing Python Security
115wdm0006/python-skills
Audits Python libraries for security vulnerabilities using Bandit, pip-audit, Semgrep, and detect-secrets. Identifies SQL injection, command injection, hardcoded credentials, secrets exposed through tracebacks, weak cryptography, and insecure deserialization. Use when reviewing library security, setting up security scanning in CI, or implementing secure coding patterns.
Building Accessible Interfaces
115wdm0006/python-skills
Makes web and app UIs usable by keyboard, screen-reader, low-vision and motion-sensitive users — semantic HTML before ARIA, labelled controls, visible focus, WCAG AA contrast measured rather than eyeballed, touch targets, reduced motion, and automated axe checks plus a manual keyboard pass in CI or before every UI PR. Use when building or restyling a screen, adding a form, modal, menu or custom control, choosing colors, or reviewing a UI change.
Building Browser Extensions
115wdm0006/python-skills
Builds and tests Manifest V3 browser extensions — service-worker message channels that survive teardown, chrome.storage read-modify-write safety, settings validation in the popup, and a Jest chrome mock that can actually fail. Use when writing or reviewing a background service worker, a popup that reads/writes chrome.storage, an extension's Jest suite, or debugging an extension whose UI silently stops responding.
Rewrite Tone
80KerberosClaw/kc_ai_skills
Use when the user wants to rewrite Markdown prose into a conversational, humorous, self-deprecating engineering tone while preserving technical accuracy and document structure. Rewrites prose sections only, keeps code blocks, diagrams, tables, English summary blocks, and factual claims intact. NOT for changing requirements, adding new technical content, or editing non-Markdown artifacts.
Align
80KerberosClaw/kc_ai_skills
Reconcile existing repository documentation with the current implementation, especially after verified hotfixes or after QA in an unattended task. A manual run first asks whether to align only the docs a specific change touched (trigger scope) or rescan the whole repo; unattended runs use the scope the dispatch states and default to the whole repo. Follow cross-repo references for evidence; edit only documentation in the authorized repo, annotating conflicting historical records. Not for fixing code, deploying, inventing requirements, or building a new documentation suite.
Rewrite Tw
80KerberosClaw/kc_ai_skills
Use when the user wants a Traditional Chinese (Taiwan) language review of Markdown or plain-text files — flagging genuinely comprehension-breaking grammar faults (missing subject, broken predicate, wrong measure word, misused connectives, inconsistent naming) and non-Taiwanese wording (mainland-Chinese terms, translationese) with replacement suggestions. High bar on grammar: only reports what actually misleads the reader; pure style preferences, punctuation nits and unavoidable loanwords are let through. Phase 1 is a read-only report; Phase 2 (applying edits) only runs after the user explicitl
Browse the most popular Claude skills, all writing & content skills, or write your own with the skills generator.