fix: sanitize public address validation responses#18
Merged
NateIsern merged 1 commit intoJun 25, 2026
Conversation
NateIsern
added a commit
that referenced
this pull request
Jun 25, 2026
Document the merged hardening PRs and bump version: - sanitize /api/validate-address response + input (#18) - limit /api/network-info to public fields (#19) - cap WebSocket frame size via maxPayload (#20) Note: #20's TCP-peer WS-IP change was dropped on merge (would break the per-IP WS cap behind the proxy); #16's trusted-proxy resolution is kept. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Motivation
validateaddressRPC (fields such asismine,iswatchonly, pubkey, labels, account, etc.)./api/validate-addressendpoint safe for unauthenticated callers by exposing only non-sensitive validation information.Description
sanitizeAddressValidationtoserver/lib/http.tswhich normalizes RPC responses and returns onlyisvalidand a validatedaddresswhen present. (new public typePublicAddressValidation).BlockCache.validateAddressreturn the sanitized shape instead of the raw RPC result by callingsanitizeAddressValidationinserver/lib/cache.ts.addressquery viaparseAddressbefore invoking RPC-backed validation inserver/index.ts.NodeAddressValidationinsrc/hooks/use-validate-address.tsand remove rendering ofismine,iswatchonly, andisscriptinsrc/components/address-validator-content.tsx.server/lib/http.test.tsthat assert sensitive fields are stripped and malformed RPC responses normalize to a safe invalid result.Testing
npm test; all tests passed (4 files passed,44 tests passed).npm run typecheck; the TypeScript build passed.sanitizeAddressValidationinserver/lib/http.test.ts, which succeeded as part of the test run.Codex Task