Skip to content

Rate limiting tweaks - #473

Merged
zwolf merged 8 commits into
masterfrom
rackattack-tweaks
Aug 19, 2026
Merged

Rate limiting tweaks#473
zwolf merged 8 commits into
masterfrom
rackattack-tweaks

Conversation

@zwolf

@zwolf zwolf commented Aug 18, 2026

Copy link
Copy Markdown
Member
  • Skip POST throttles for users with an admin Role
  • Use id from decoded token as key
  • Send notification to Honeybadger when Rack::Attack is triggered
  • Change general per-IP POST limit to a track: HB will get notified but no throttling

post review:

  • Verify JWT via public key to prevent token forgery
  • Admins skip throttling

@yuenmichelle1 yuenmichelle1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple of questions mostly regarding the change from hashed_token to current_user.

As far as I understand, token authentication for Talk happens in the application controller layer (See: application_controller.rb) and rack attack is middleware that happens before the controller. With current_user in rack_attack.rb not verifying token signature, I think forged tokens might allow attackers to throttle users incorrectly.

But I have not tested, just sniffed weird on a glimpse.

Comment thread config/initializers/rack_attack.rb
Comment thread config/initializers/rack_attack.rb
@zwolf

zwolf commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Forgery is possible enough that adding token verification is a good idea. Added that logic to the initializer. I also added the public key as secrets in the cluster and mounted them as volumes via the deployments.

@zwolf
zwolf merged commit c44c9dd into master Aug 19, 2026
3 of 4 checks passed
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.

3 participants