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.

115 stars 18 forksWriting & Content Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add wdm0006/python-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add wdm0006/python-skills --skill rendering-untrusted-content
Manual install
git 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-content

Personal 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:
Read the full skill on GitHub

Details

Skill name
rendering-untrusted-content
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

115

wdm0006/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.

Security18

Building Accessible Interfaces

115

wdm0006/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.

Frontend & Design18

Building Browser Extensions

115

wdm0006/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.

Software Development18

Rewrite Tone

80

KerberosClaw/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.

Writing & ContentIn 1 list13

Align

80

KerberosClaw/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.

Writing & ContentIn 1 list13

Rewrite Tw

80

KerberosClaw/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

Writing & ContentIn 1 list13

Browse the most popular Claude skills, all writing & content skills, or write your own with the skills generator.