PolicyEngine / PolicyEngine/policyengine-uk-chat
Rate limits are not security controls
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 16h 46m
- Merged PRs (30d)
- 2
Description
Problem
Rate limiting is currently not a substitute for backend authentication and authorization.
Observed behavior:
- The limiter keys off request-supplied
X-User-IdorX-Forwarded-For. - Those values can be spoofed or unstable depending on proxy configuration.
Risk
Rate limits may reduce abuse volume but cannot prove caller identity or protect user-specific resources. If protected endpoints rely on rate limits instead of authentication/ownership checks, authorization bypasses remain possible.
Expected behavior
Rate limiting should remain a defense-in-depth control, while backend auth and ownership checks enforce access decisions.
Acceptance criteria
- Protected endpoints do not rely on request-supplied
X-User-Idas an identity source. - Rate-limit keys use trusted request metadata or verified authenticated identity.
- Proxy/header trust boundaries are documented.
- Tests cover spoofed
X-User-Id/forwarded-header behavior where practical.
Contributor guide
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 by locating the rate limiter and the protected endpoints that use request-supplied X-User-Id or forwarded headers. Trace how identity and proxy metadata are trusted, then review the existing tests before adding coverage for spoofed headers. Done means access decisions use verified identity or ownership checks, rate limiting remains defense in depth, and trust boundaries are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, authorization, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100