fix: add typeof string guard for email/password/name in auth routes to prevent type confusion#2432
Conversation
…o prevent type confusion
|
Someone is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 1 hour. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI Status
Note: The Test Platform and Worker Consistency failures are pre-existing in the upstream repository and are NOT caused by this fix. The upstream main branch passes all CI checks on its own commit. Lint, CodeQL, and Prisma checks pass cleanly. Ready to merge pending maintainer review. |
|
Closing this PR. The branch is based on an older commit of upstream/main and has drifted from the current main. The upstream repository has received significant updates since this PR was opened, causing CI type-check and test failures due to merge conflicts with the base branch. Please re-open as a fresh PR against the current main if the fix is still needed. |
Summary
Fixes a type confusion vulnerability in
app/api/auth/login/route.tsandapp/api/auth/signup/route.ts. The routes call.toLowerCase()onemail(andnamein signup) without verifying the value is actually a string. A malicious client can send a JSON object or array, bypassing the truthiness check ({}is truthy) and causing a TypeError that results in a 500 Internal Server Error.Fix
Added
typeof email !== "string"(andtypeof name !== "string"for signup) to the input validation guard, returning a 400 Bad Request for non-string values.Impact