René's URL Explorer Experiment


Title: fix(auth): rate limit the password reset endpoints by waleedlatif1 · Pull Request #6553 · simstudioai/sim · GitHub

Open Graph Title: fix(auth): rate limit the password reset endpoints by waleedlatif1 · Pull Request #6553 · simstudioai/sim

X Title: fix(auth): rate limit the password reset endpoints by waleedlatif1 · Pull Request #6553 · simstudioai/sim

Description: Summary /api/auth/forget-password calls auth.api.requestPasswordReset without headers, which bypasses Better Auth's rate limiter entirely (it lives in the HTTP router, not the endpoint). The route was an unthrottled email-send amplifier keyed on any address a caller chose Adds a per-IP budget before parsing (cheap pre-parse gate) and a per-recipient budget — no per-IP limit can stop a distributed attempt to bomb one mailbox The recipient key is normalized and hashed, so the bucket store never holds an address and long inputs cannot inflate key cardinality Enforced before any user lookup and identically whether or not the account exists, so a 429 is not an account-existence oracle Also throttles /api/auth/reset-password, which had no rate limiting and is an online token-guessing surface Why not just pass headers to auth.api.* That looks like the deeper fix but regresses behavior: Better Auth's limiter throws an APIError, which these routes' catch blocks project as a 500 with the raw message, not a 429. It is also per-IP only, so it cannot express the per-recipient dimension that mailbox bombing actually requires. internalRateLimits also cannot cover these routes — its enforce runs after authenticate and takes a Principal, and defineInternalJsonRoute has no unauthenticated path. Imperative enforce* is the established pattern here (19 route files already use it; zero use a declarative throttling policy, because none exists). Type of Change Bug fix (security hardening) Testing bun run type-check clean; 230 tests across 16 files in app/api/auth + lib/core/rate-limiter pass; bun run lint and check:api-validation clean. Both new rate-limit tests verified to fail when their guard is stubbed out. Follow-up (not in this PR) rate_limit_bucket has no TTL or cleanup job on the Postgres adapter, so the recipient dimension is attacker-controlled key space that grows unbounded on Postgres-backed deployments. Redis-backed deployments are unaffected (redis-token-bucket.ts:41 sets EXPIRE). app/api/contact, app/api/demo-requests, and app/api/help/integration-request still hand-roll what route-helpers does, including a byte-identical copy of DEFAULT_PUBLIC_IP_ROUTE_LIMIT. Unifying them changes the user-visible 429 string on three public forms, so it is left out of this change. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary /api/auth/forget-password calls auth.api.requestPasswordReset without headers, which bypasses Better Auth's rate limiter entirely (it lives in the HTTP router, not the endpoint). The r...

X Description: Summary /api/auth/forget-password calls auth.api.requestPasswordReset without headers, which bypasses Better Auth's rate limiter entirely (it lives in the HTTP router, not the endpoint). T...

Opengraph URL: https://github.com/simstudioai/sim/pull/6553

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fa901454-7a73-20c1-c512-cdf08924a727
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEA32:19E560:169F:1FB3:6AFB42C5
html-safe-noncef14239af147e476f16e007593b38277956c78e6f3f42e89990d3085b0d1b8c9d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTMyOjE5RTU2MDoxNjlGOjFGQjM6NkFGQjQyQzUiLCJ2aXNpdG9yX2lkIjoiMzA1MzQzNDI2MDI5MzcyMTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac189908131617ca949b6c2005c169851d388b5fb53cc3d2903c2c91857013dba7
hovercard-subject-tagpull_request:4256153846
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6553/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary /api/auth/forget-password calls auth.api.requestPasswordReset without headers, which bypasses Better Auth's rate limiter entirely (it lives in the HTTP router, not the endpoint). The r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6553/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6553%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6553%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6553/files
Reloadhttps://github.com/simstudioai/sim/pull/6553/files
Reloadhttps://github.com/simstudioai/sim/pull/6553/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests200 (200)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/forget-password-rate-limithttps://github.com/simstudioai/sim/tree/fix/forget-password-rate-limit
Conversation 8 https://github.com/simstudioai/sim/pull/6553
Commits 1 https://github.com/simstudioai/sim/pull/6553/commits
Checks 30 https://github.com/simstudioai/sim/pull/6553/checks
Files changed https://github.com/simstudioai/sim/pull/6553/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6553/files
fix(auth): rate limit the password reset endpoints https://github.com/simstudioai/sim/pull/6553/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/6553/files
d2df8b3 fix(auth): rate limit the password reset endpoints waleedlatif1 Aug 11, 2026 https://github.com/simstudioai/sim/pull/6553/commits/d2df8b3f5398bdc267bf00d6ab4f648345fabe50
Clear filters https://github.com/simstudioai/sim/pull/6553/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6553/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6553/files
route.test.ts https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
route.ts https://github.com/simstudioai/sim/pull/6553/files#diff-07d6868e3414706b90a068a04546aa6ec9c1263de810b67c2897c8175aa9dfd3
route.test.ts https://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
route.ts https://github.com/simstudioai/sim/pull/6553/files#diff-419a1762d99421b50658793cb261140110c8db97d477fa22fb9a0e8b3f940d11
index.ts https://github.com/simstudioai/sim/pull/6553/files#diff-c3af03f2a7123eb40ff610e3afe8326b1334748b109ae22ecbbefa7a642bf5ec
route-helpers.ts https://github.com/simstudioai/sim/pull/6553/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
apps/sim/app/api/auth/forget-password/route.test.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/app/api/auth/forget-password/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
https://github.com/simstudioai/sim/pull/6553/files#diff-8b2789814495d0509e060abd600ddc55454752873edd8c8c6c48ce4c90fb2ad6
apps/sim/app/api/auth/forget-password/route.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-07d6868e3414706b90a068a04546aa6ec9c1263de810b67c2897c8175aa9dfd3
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/app/api/auth/forget-password/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-07d6868e3414706b90a068a04546aa6ec9c1263de810b67c2897c8175aa9dfd3
Please reload this pagehttps://github.com/simstudioai/sim/pull/6553/files
https://github.com/simstudioai/sim/pull/6553/files#diff-07d6868e3414706b90a068a04546aa6ec9c1263de810b67c2897c8175aa9dfd3
https://github.com/simstudioai/sim/pull/6553/files#diff-07d6868e3414706b90a068a04546aa6ec9c1263de810b67c2897c8175aa9dfd3
apps/sim/app/api/auth/reset-password/route.test.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/app/api/auth/reset-password/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
https://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
https://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
https://github.com/simstudioai/sim/pull/6553/files#diff-9e74034055a50ac9d1bbdb60baea7f37f515eda2b092d558ec5141ba6e031882
apps/sim/app/api/auth/reset-password/route.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-419a1762d99421b50658793cb261140110c8db97d477fa22fb9a0e8b3f940d11
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/app/api/auth/reset-password/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-419a1762d99421b50658793cb261140110c8db97d477fa22fb9a0e8b3f940d11
https://github.com/simstudioai/sim/pull/6553/files#diff-419a1762d99421b50658793cb261140110c8db97d477fa22fb9a0e8b3f940d11
apps/sim/lib/core/rate-limiter/index.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-c3af03f2a7123eb40ff610e3afe8326b1334748b109ae22ecbbefa7a642bf5ec
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/lib/core/rate-limiter/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-c3af03f2a7123eb40ff610e3afe8326b1334748b109ae22ecbbefa7a642bf5ec
https://github.com/simstudioai/sim/pull/6553/files#diff-c3af03f2a7123eb40ff610e3afe8326b1334748b109ae22ecbbefa7a642bf5ec
apps/sim/lib/core/rate-limiter/route-helpers.tshttps://github.com/simstudioai/sim/pull/6553/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
View file https://github.com/simstudioai/sim/blob/d2df8b3f5398bdc267bf00d6ab4f648345fabe50/apps/sim/lib/core/rate-limiter/route-helpers.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6553/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6553/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
https://github.com/simstudioai/sim/pull/6553/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
https://github.com/simstudioai/sim/pull/6553/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
Please reload this pagehttps://github.com/simstudioai/sim/pull/6553/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.