-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(aggregator): wrap unexpected XRPC errors + harden PDS egress against SSRF (review round 1) #2117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ascorbic
merged 4 commits into
feat/plugin-registry-labelling-service
from
fix/aggregator-sol-r2
Jul 18, 2026
Merged
fix(aggregator): wrap unexpected XRPC errors + harden PDS egress against SSRF (review round 1) #2117
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
71feb46
fix(aggregator): wrap unexpected XRPC errors and harden PDS egress ag…
ascorbic 2108ce4
fix(aggregator): retry PDS verification on resolver-infra failures, d…
ascorbic 2317d38
fix(aggregator): retry PDS verification on empty DNS answer, don't de…
ascorbic e7842ed
fix(aggregator): delay re-delivery on transient DNS-resolution failure
ascorbic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion] All
SsrfErrorcases are collapsed intoPDS_ADDRESS_BLOCKED, butresolveAndValidateExternalUrlalso throwsSsrfErrorfor resolver failures (DoH network error, SERVFAIL, timeout) with a message prefix ofCould not resolve hostname:. Currently those infrastructure failures become a permanent dead-letter reason, even though they are transient and retryable.If the intent is fail-closed on any validation incapacity, add a test proving that a throwing resolver lands in
dead_letterswithPDS_ADDRESS_BLOCKEDso the behavior is explicit. If the intent is the stated "preserve transient network classifications", distinguish resolver failures from true address blocks and map them toPDS_NETWORK_ERRORinstead. The cleanest fix is to enrichSsrfErrorwith a machine-readablecode/causein the shared helper, but a local prefix check is also possible today:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in
2108ce4awith the transient-distinguishing path (option 2 — consistent with the "preserve transient classifications" intent).SsrfErrorcarries only a constantcode("SSRF_BLOCKED") with no structured discriminator, so I keyed on the resolver-failure message prefix (Could not resolve hostname:, as a module constant) — resolver-infra failures (DoH network error / SERVFAIL / timeout) now map toPDS_NETWORK_ERROR(transient → retried), while genuine private/reserved-IP/blocked-host/empty-resolution blocks stayPDS_ADDRESS_BLOCKED(permanent). A unit test asserts the transient mapping so a future wording change in ssrf.ts breaks the test rather than silently mis-classifying. Added the requested tests: throwing resolver → retry (retried=1, 0 dead-letters); private-IP → permanent dead-letter; and the redirect-limit boundary (exactly 4 fetches, 5th refused). The same latent conflation existed in the labeler's pds-verify (#2113) and is being fixed there too.A cleaner long-term fix — enriching
SsrfErrorwith a machine-readablekindin the shared helper so callers don't string-match — is a good follow-up but out of scope here to keep this PR and #2113 independent of a shared-core change.~ 🤖 Claude Fable 5