Rate limit device creation by application ID instead of device ID#7756
Merged
Conversation
happyRip
requested changes
Nov 17, 2025
Member
happyRip
left a comment
There was a problem hiding this comment.
LGTM, but fix linter issues.
66dd310 to
15b9b2d
Compare
Contributor
Author
|
@happyRip I ended up looking for other places where this could happen. As far as I know only requests that implement the
I ended up using only the full-method and the auth-token as a key. lorawan-stack/pkg/ratelimit/resource.go Lines 93 to 100 in 3d0d2f1 This means that on creation, |
15b9b2d to
66173e6
Compare
Previously, Create<Entity>Request was rate-limited per the entityID generated by the IDString interface, which was ineffective since each new entity has an unique ID. This allowed unlimited device creation attempts. Now rate limiting is applied withou the entityID, properly restricting create requests using full-method and auth-token strings as key.
66173e6 to
419720f
Compare
johanstokking
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, CreateEndDeviceRequest was rate-limited per device ID, which was ineffective since each new device has a unique ID. This allowed unlimited device creation attempts per application.
Now rate limiting is applied per application ID, properly restricting the rate of device creation requests at the application level.
Summary
This fixes a reported behavior where the rate-limiter does not work as intented
Changes
Testing
Steps
Unit tests
Regressions
This is a bug fix
Checklist
README.mdfor the chosen target branch.CHANGELOG.md.CONTRIBUTING.md, there are no fixup commits left.