Skip to content

security: HTML-encode user input in renderAlert to prevent reflected XSS#714

Merged
lane711 merged 1 commit intomainfrom
security/reflected-xss-auth-pages
Mar 28, 2026
Merged

security: HTML-encode user input in renderAlert to prevent reflected XSS#714
lane711 merged 1 commit intomainfrom
security/reflected-xss-auth-pages

Conversation

@lane711
Copy link
Copy Markdown
Collaborator

@lane711 lane711 commented Mar 27, 2026

Summary

Fixes reflected XSS vulnerability on /auth/login and /auth/register pages via the error query parameter.

No authentication required to exploit.

Changes

  • packages/core/src/templates/alert.template.ts — Applied escapeHtml() to data.message and data.title before HTML interpolation
  • packages/core/src/templates/components/alert.template.ts — Same fix (duplicate template file)
  • packages/core/src/__tests__/templates/alert-xss.test.ts — 7 new tests verifying XSS payloads are properly encoded

Testing

  • All 25 tests pass
  • Type-check clean

Credit

Vulnerability reported by Zhengyu Wang

Fixes #711

🤖 Generated with Claude Code

Fixes #711

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lane711 lane711 merged commit c0ea5cb into main Mar 28, 2026
2 checks passed
lane711 added a commit that referenced this pull request Mar 30, 2026
Security hardening release:
- SQL injection fix via sort order validation (#713)
- Reflected XSS fix on auth pages (#714)
- Stored XSS fix in content preview (#715)
- Security headers middleware (#708)
- Auth endpoint rate limiting (#707)
- CORS restrictions (#706)
- PBKDF2 password hashing (#705)
- JWT secret to environment variable (#704)

Bug fixes:
- Radio field support (#723)
- Confirm dialogs for repeater/block deletes (#722)
- Rich text editor field types (#721)
- user_profiles migration in core (#718)
- itemTitle for structured arrays (#725)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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: Reflected XSS via error parameter on /auth/login and /auth/register

1 participant