Skip to content

🔒 Fix DoS Risk in Rate Limiter via Unbounded Memory - #124

Merged
Sanan507 merged 2 commits into
masterfrom
jules/fix-dos-rate-limit-memory-4962733754421285856
Sep 11, 2026
Merged

Sanan507 merged 2 commits into
masterfrom
jules/fix-dos-rate-limit-memory-4962733754421285856

Conversation

@Sanan507

Copy link
Copy Markdown
Owner

🎯 What: Replaced the unbounded ConcurrentHashMap in RateLimitFilter with a Caffeine Cache.
⚠️ Risk: The previous map grew infinitely as new IP addresses and buckets were encountered. An attacker could exploit this by making requests from many spoofed IPs (or just sending varied bucket names, if accessible), leading to rapid memory exhaustion (OOM) and causing a Denial of Service (DoS) for the entire application.
🛡️ Solution: Integrated Caffeine to automatically evict sliding window entries. The cache is configured with a strict upper bound (maximumSize(100_000)) and an automatic expiration policy (expireAfterAccess(1, TimeUnit.MINUTES)) that perfectly aligns with the rate limit sliding window size. This guarantees that old IPs are cleaned up and memory footprint remains bounded.


PR created automatically by Jules for task 4962733754421285856 started by @Sanan507

Migrate `RateLimitFilter` from an unbounded `ConcurrentHashMap` to a size-bounded, time-evicting `Caffeine` cache to prevent memory exhaustion DoS attacks.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
algorithm-race-visualizer Ready Ready Preview Sep 11, 2026 3:40pm UTC

@Sanan507
Sanan507 merged commit 50e7e02 into master Sep 11, 2026
4 checks passed
@Sanan507
Sanan507 deleted the jules/fix-dos-rate-limit-memory-4962733754421285856 branch September 15, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant