Skip to content

fix(notes): sanitize rendered Markdown HTML (XSS) - #171

Open
iuyua9 wants to merge 1 commit into
snehmatic:mainfrom
iuyua9:codex/mindloop-notes-xss-20260813
Open

fix(notes): sanitize rendered Markdown HTML (XSS)#171
iuyua9 wants to merge 1 commit into
snehmatic:mainfrom
iuyua9:codex/mindloop-notes-xss-20260813

Conversation

@iuyua9

@iuyua9 iuyua9 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • sanitize rendered Markdown at the shared mdToHTML boundary before it is marked as trusted template HTML
  • cover both note and journal views without changing stored content
  • add malicious-input and common-Markdown regression tests

Security impact

User-authored Markdown was passed through template.HTML without an HTML policy, allowing stored script, event-handler, iframe, and javascript-URL payloads. bluemonday.UGCPolicy removes those unsafe constructs while retaining standard Markdown formatting.

Validation

  • go test ./api/v1 -run TestMdToHTML -count=1
  • go test ./... -run '^$'
  • go vet ./...
  • git diff --check

Closes #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Notes feature

2 participants