Add rate limiting to auth, public share pages and metadata fetching
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- HTML
- Stars
- 10
- Forks
- 0
- Avg merge
- 2h 52m
- Merged PRs (30d)
- 20
Description
Tier 2 — security
Problem
Nothing in the app is throttled. In particular:
- Login and registration accept unlimited attempts (Identity lockout helps, but only per-account).
/shared/{token}is anonymous and unthrottled, so share tokens can be brute-forced and the page is a free amplification target (it loads full resource rows including thumbnails).- The metadata fetcher lets any authenticated user make the server issue arbitrary outbound HTTP requests on demand, with no per-user budget.
Evidence
- No
AddRateLimiteranywhere in the repository LearnStack/Components/Pages/SharedView.razor:4—[AllowAnonymous]LearnStack.Core/Extensions/ServiceCollectionExtensions.cs:29-34— unthrottledHttpClient
Proposed fix
builder.Services.AddRateLimiter(...)with a fixed window on/Account/*.- A per-IP window on
/shared/{token}and/friends/accept/{token}. - A per-user concurrency limiter around OpenGraph fetches.
Acceptance criteria
- Repeated login attempts from one IP are throttled with 429
- Share-token enumeration is rate-limited
- One user cannot saturate the outbound HTTP client
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LearnStack/Components/Pages/SharedView.razor:4 and LearnStack.Core/Extensions/ServiceCollectionExtensions.cs:29-34, then trace the /Account/*, /shared/{token}, /friends/accept/{token}, and OpenGraph fetch entry points. Done means repeated login attempts return 429, share-token enumeration is throttled, and one user cannot saturate outbound HTTP requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- authentication, backend, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100