Source
PR #191 review threads:
Problems
-
<img> tag enables external tracking: User-generated content (news articles, game descriptions) could embed <img src="https://attacker.com/track"> to exfiltrate IP addresses. If images are not strictly needed, remove from allowlist. If needed, add Content Security Policy or image proxy.
-
Security rationale undocumented: The allowlist decisions (why img included, why style/on*/script excluded, why class/id permitted) should be documented in code comments for maintainability.
Fix
// Security: Allowed HTML tags for user-generated content rendering.
// - img: allowed for Markdown image syntax; be aware of privacy implications
// (external image tracking). Mitigate with CSP or image proxy if needed.
// - script, style, iframe, form, input, object, embed: intentionally excluded
// to prevent XSS and UI redressing.
// - class, id: permitted for styling; sanitized by DOMPurify defaults.
const ALLOWED_TAGS = [...]
Relates: #191
Source
PR #191 review threads:
Problems
<img>tag enables external tracking: User-generated content (news articles, game descriptions) could embed<img src="https://attacker.com/track">to exfiltrate IP addresses. If images are not strictly needed, remove from allowlist. If needed, add Content Security Policy or image proxy.Security rationale undocumented: The allowlist decisions (why
imgincluded, whystyle/on*/scriptexcluded, whyclass/idpermitted) should be documented in code comments for maintainability.Fix
Relates: #191