kasuken / kasuken/LearnStack

Add rate limiting to auth, public share pages and metadata fetching

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

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 AddRateLimiter anywhere in the repository
  • LearnStack/Components/Pages/SharedView.razor:4[AllowAnonymous]
  • LearnStack.Core/Extensions/ServiceCollectionExtensions.cs:29-34 — unthrottled HttpClient
Proposed fix
  1. builder.Services.AddRateLimiter(...) with a fixed window on /Account/*.
  2. A per-IP window on /shared/{token} and /friends/accept/{token}.
  3. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.