fix(web): repair 6 dead internal links + harden forum markdown against stored XSS

Routing: footer "Explorer"/"Validators" pointed to non-existent /network (4 spots
in AppLayout + LandingPageDesktop) and Explorer/Forum quick-links pointed to bare
/governance (no route) -> all hit the 404 catch-all. Repointed to /explorer and
/governance/assembly; footer "Vote" /-> /elections.

Security (stored XSS): DiscussionThread.parseMarkdown did regex->HTML then
dangerouslySetInnerHTML with no escaping/sanitizer, so <img onerror>/javascript:
links in user comments executed. Now escape HTML first, then DOMPurify-sanitize the
output to a safe tag/attr allow-list with http(s)-only hrefs.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-07-24 22:43:30 -07:00
1 parent 0651b80eb7
commit 686eecc09e
5 files changed
+27 -11

No files matched your search

+1 -1
View File
@@ -860,7 +860,7 @@ const Explorer: React.FC = () => {
{t('explorer.telemetry')}
</a>
<a
href="/governance"
href="/governance/assembly"
className="flex items-center gap-2 p-3 rounded-lg bg-gray-800 hover:bg-gray-750 text-gray-300 hover:text-white transition-colors"
>
<Users className="w-4 h-4 text-blue-400" />
+1 -1
View File
@@ -429,7 +429,7 @@ const Forum: React.FC = () => {
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<a href="/governance" className="block text-gray-400 hover:text-green-400 text-sm transition-colors">
<a href="/governance/assembly" className="block text-gray-400 hover:text-green-400 text-sm transition-colors">
→ {t('forum.govDashboard')}
</a>
<a href="/docs" className="block text-gray-400 hover:text-green-400 text-sm transition-colors">