security: enforce strict input validation and payload bounds#1706
Open
SurbhiAgarwal1 wants to merge 7 commits into
Open
security: enforce strict input validation and payload bounds#1706SurbhiAgarwal1 wants to merge 7 commits into
SurbhiAgarwal1 wants to merge 7 commits into
Conversation
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
5cae97f to
8c74cea
Compare
…k during initialization Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
Signed-off-by: SurbhiAgarwal <agarwalsurbhi1807@gmail.com>
HayimShaul
reviewed
Jun 16, 2026
HayimShaul
reviewed
Jun 16, 2026
HayimShaul
reviewed
Jun 16, 2026
HayimShaul
reviewed
Jun 16, 2026
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
HayimShaul
reviewed
Jun 18, 2026
Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
Contributor
|
Looks good to me. |
HayimShaul
approved these changes
Jun 23, 2026
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Description
This PR implements strict input validation and payload bounds within the
tokens.Service.Appendmethod to protect the system against resource exhaustion and potential Denial of Service (DoS) attacks from malformed or oversized finality data.Changes
MaxTokenPayloadSize: 1MB (coversTokenOnLedgerandTokenOnLedgerMetadata)MaxTokenOutputsPerTx: 1000 outputsMaxBulkDeleteSize: 10,000 IDsMaxWalletIDSize: 1024 bytesMaxOwnerRawSize: 2048 bytesMaxIssuerRawSize: 2048 bytesvalidateAppendRequestwhich performs in-memory checks before any database transactions or storage operations are initiated.token/services/tokens/validation_test.gocovering edge cases, limit violations, and structural validation.Verification Results
token/services/tokenspassed successfully.golangci-lint(v2) standards, includingnlreturnandtestifylintcompliance.Fixes: #1608