fix: sanitize AI-generated content to prevent stored XSS #139
No reviewers
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot!139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/116-sanitize-ai-generated-content"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
sanitizeGeneratedContent()utility that HTML-entity-encodes<,>,&,", and'in AI-generated document contentdocument-generator.tsafter receiving LLM output and before storing/returning, preventing stored XSS<script>,<img onerror>, nested tags, event handlers) and benign input (ampersands, quotes, Markdown syntax)Closes #116
Test plan
<script>alert(1)</script>encoded to safe entities<img onerror>XSS vectors neutralized&, quotes correctly encoded