📌 Description
IssuesTab (src/features/maintainers/components/issues/IssuesTab.tsx) renders discussion content via RenderMarkdownContent from src/app/utils/renderMarkdown.tsx, which uses react-markdown with no explicit sanitization and no javascript: link guard. Discussion text originates from external GitHub content.
💡 Why it matters: Unsanitized maintainer-discussion markdown is an XSS vector.
🧩 Requirements and context
- Add
rehype-sanitize (or equivalent) to RenderMarkdownContent.
- Block
javascript:/data: URLs in links.
- Ensure raw HTML in markdown is not rendered.
- Add tests asserting script/HTML payloads are neutralized.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b security/sanitize-discussion-markdown
2. Implement changes
- Write/modify the relevant source:
src/app/utils/renderMarkdown.tsx
- Write comprehensive tests:
src/app/utils/renderMarkdown.test.tsx
- Add documentation: TSDoc + security note
- Include TSDoc doc comments
- Validate security assumptions: XSS payloads neutralized
3. Test and commit
- Cover edge cases:
<script>, inline event handlers, javascript: links
- Include test output and security notes in the PR description.
Example commit message
fix(security): sanitize discussion markdown rendering
✅ Acceptance criteria
🔒 Security notes
Mitigates stored XSS from external GitHub discussion content.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
IssuesTab(src/features/maintainers/components/issues/IssuesTab.tsx) renders discussion content viaRenderMarkdownContentfromsrc/app/utils/renderMarkdown.tsx, which uses react-markdown with no explicit sanitization and nojavascript:link guard. Discussion text originates from external GitHub content.🧩 Requirements and context
rehype-sanitize(or equivalent) toRenderMarkdownContent.javascript:/data:URLs in links.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/app/utils/renderMarkdown.tsxsrc/app/utils/renderMarkdown.test.tsx3. Test and commit
npm run test<script>, inline event handlers,javascript:linksExample commit message
✅ Acceptance criteria
🔒 Security notes
Mitigates stored XSS from external GitHub discussion content.
📋 Guidelines