security: sync upstream XSS fix + moderation history (reports SET NULL)

- renderMarkdown: sanitize marked output with sanitize-html (allowed
  tags/attrs whitelist, http/https schemes only, strip on* attrs) —
  prevents stored XSS in posts/replies/signatures
- schema: reports.post_id ON DELETE CASCADE → SET NULL (keep moderation
  history when a reported post is deleted); migration applied to prod DB
This commit is contained in:
lezi-fun committed 2026-08-11 17:06:56 +08:00
1 parent 7cc1f0e228
commit 7cdb7c1ac2
4 files changed
+63 -6

No files matched your search

+2 -1
View File
@@ -23,7 +23,8 @@
"pg": "^8.11.3",
"react": "19",
"react-dom": "19",
"react-i18next": "^17.0.11"
"react-i18next": "^17.0.11",
"sanitize-html": "^2.17.6"
},
"devDependencies": {
"@opennextjs/cloudflare": "^1.20.2",