[PR #1931] [CLOSED] fix: error page not sanitizing error message input #4076

Closed
opened 2026-03-13 11:31:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1931
Author: @aidenybai
Created: 3/22/2025
Status: Closed

Base: mainHead: main


📝 Commits (1)

📊 Changes

3 files changed (+264 additions, -35 deletions)

View changed files

📝 packages/better-auth/package.json (+1 -0)
📝 packages/better-auth/src/api/routes/error.ts (+2 -1)
📝 pnpm-lock.yaml (+261 -34)

📄 Description

This PR fixes the XSS vulnerability found by @ensyzip.

For example, a route like /api/auth/error?error=%3Cimg/src/onerror=alert(document.cookie)%3E would alert the contents of document.cookie. Any arbitrary javascript may be run here


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/1931 **Author:** [@aidenybai](https://github.com/aidenybai) **Created:** 3/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`957a1e9`](https://github.com/better-auth/better-auth/commit/957a1e987e5071e0a4a75fadd5bbaeaa7c06075f) fix: no xss sanitize ### 📊 Changes **3 files changed** (+264 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+1 -0) 📝 `packages/better-auth/src/api/routes/error.ts` (+2 -1) 📝 `pnpm-lock.yaml` (+261 -34) </details> ### 📄 Description This PR fixes the [XSS vulnerability found by @ensyzip](https://x.com/ensyzip/status/1903281440684757377). For example, a route like `/api/auth/error?error=%3Cimg/src/onerror=alert(document.cookie)%3E` would alert the contents of document.cookie. Any arbitrary javascript may be run here --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 11:31:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#4076