mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 22:21:21 +09:00
feat(security): HTML-sink sweep guard (D4) — keep XSS sinks swept
Plan 55 Phase 1. The sweep found zero vulnerabilities: every raw-HTML sink is safe by construction (escape-first SQL/file highlighters, sanitizeSvgInner for extension icons, the escape-then-allowlist markdown renderer) and the backend has no |safe/Markup(/render_template_string. To keep it that way: scripts/check-html-sinks.mjs (wired into npm run lint) and a Python mirror test (test_html_sink_sweep.py, runs in the backend suite) fail on any raw-HTML sink that neither references an allowlisted sanitizer nor carries a 'sink-safe:' annotation. Standardized annotations on the three variable-fed sinks (markdown, SQL editor, marketplace icon) and documented the rule in SECURITY.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cf9cc5d662
commit
28cece380f
7 files changed
+194
-1
No files matched your search
@@ -46,6 +46,7 @@ const SqlEditor = forwardRef(function SqlEditor({ value, onChange, onKeyDown, pl
|
||||
className="dbx-sqled__hl"
|
||||
ref={preRef}
|
||||
aria-hidden="true"
|
||||
/* sink-safe: hlSql() esc()-escapes each line before tinting */
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
<textarea
|
||||
|
||||
Reference in new issue
Block a user