fix: remediate round 2 audit — API layer (#39)#50
Merged
Conversation
NEW-1: Validate signature (64B) and public key (32B) lengths in GraphQL TransactionInput.ToTransaction, matching REST endpoint validation. NEW-2: Cap /v1/call gas limit at chainParams.BlockGasLimit to prevent unbounded compute via ulong.MaxValue gas limit. NEW-3: Add maxPools pagination parameter to /v1/pools (default 100, max 1000) to prevent unbounded pool iteration. NEW-4: Add faucet nonce retry — if mempool rejects due to nonce conflict, retry once with incremented nonce. NEW-5: Add per-IP rate limiting (100 req/min fixed window) via Microsoft.AspNetCore.RateLimiting middleware. NEW-6: Add CORS middleware with permissive default policy for API access from explorer and external clients. NEW-7: Remove exception type name from GraphQL mutation error messages to prevent internal type information leakage.
The test was still asserting old L-1 behavior (exception type in error), but NEW-7 intentionally removed it to prevent information leakage.
# Conflicts: # src/api/Basalt.Api.Rest/RestApiEndpoints.cs
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.
Summary
TransactionInput.ToTransaction(), matching REST validation/v1/callgas limit atBlockGasLimitto prevent unbounded computemaxPoolspagination to/v1/pools(default 100, max 1000)Microsoft.AspNetCore.RateLimitingCloses #39
Test plan