Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Security

Since 0.1.0-alpha.22
What the editor's value can hold, where it's sanitized, and how to show it safely.

The editor's value is sanitized on the server by RichTextSanitizer every time it binds, from a post or on an interactive page. Anyone can post to a form, so the server never trusts what the browser sends.

The sanitizer writes a new document from what it allows: paragraphs, headings, lists, quotes, code, rules, bold, italic, underline, strikethrough, links, images and tables. href and src are limited to web, mail, phone and relative URLs. Scripts, event handlers and javascript: links never get through.

Styles and classes are dropped, except the editor's own: its classes for alignment, color, highlight and size, a font or size from your Fonts and FontSizes, and, with CustomColors, a color or highlight as six hex digits.

Pasted text goes through the same list, so a paste from Word or a web page keeps its headings, lists and bold, and drops its fonts, colors and classes. Ctrl+Shift+V pastes plain text.

Show saved HTML with RichText, which sanitizes it again as it renders, so HTML saved before, or written by another system, is safe too. To clean HTML yourself, call RichTextSanitizer.Sanitize. A Content Security Policy that blocks inline script adds a second line of defense.

Connection lost

Rejoining the server…