Skip to content

Conversation

@jmaddington
Copy link
Owner

Summary

  • Added escapeHtml function to properly sanitize error messages
  • Updated failSvg function to escape HTML characters in error messages before rendering in SVG
  • Prevents Cross-Site Scripting (XSS) attacks via error message manipulation

Test plan

  • Verified the fix by ensuring HTML special characters in error messages are properly escaped
  • Characters like <, >, &, ' and " are now converted to their HTML entity equivalents
  • This prevents error messages from being interpreted as HTML/JavaScript

Closes #20

🤖 Generated with Claude Code

jmaddington and others added 2 commits March 31, 2025 14:18
- Added escapeHtml function to properly sanitize error messages
- Updated failSvg function to escape error messages before rendering in SVG
- Prevents cross-site scripting attacks via error message manipulation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added HTML escaping to format error message to prevent reflected XSS attacks
- Uses the escapeHtml function to sanitize user-provided format parameter
- Ensures unrecognized file format values cannot be used for XSS attacks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Security: Fix XSS vulnerability with exception text (CodeQL #7)

2 participants