fix(relay): stop disclosing internal origins via NIP-98 and push - #5020
Open
VaibhavJain2609 wants to merge 1 commit into
Open
fix(relay): stop disclosing internal origins via NIP-98 and push#5020VaibhavJain2609 wants to merge 1 commit into
VaibhavJain2609 wants to merge 1 commit into
Conversation
Unauthenticated callers could learn a reverse-proxied relay's bind address from NIP-98 401 bodies and NIP-11 push.origin. Return client-safe auth messages and omit push descriptors for private/loopback hosts. Closes block#4954 Signed-off-by: Vaibhav Jain <vaibhavjain@Vaibhavs-MacBook-Pro.local> Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
tracing::warn!; clients getAuthError::client_message().pushdescriptors when the tenant host is private, loopback, orlocalhost(includinglocalhost.), sopush.origincannot advertise internal topology on the unauthenticated root document.buzz-authandbuzz-relay.Closes #4954
Related surfaces checked
"NIP-98 auth failed"(no change needed).buzz-mediaalready collapses auth failures to"authentication failed".Test plan
cargo test -p buzz-auth --libcargo test -p buzz-relay --lib push_descriptorcargo test -p buzz-relay --lib push_origin_hostcargo test -p buzz-relay --lib verify_bridge_auth_rejects_nip98cargo test -p buzz-relay --lib moderation_read_query_bearing_nip98_event_rejectedcargo clippy -p buzz-auth --lib -- -D warningsPOST /queryreturns{"error":"NIP-98: URL mismatch"}with no host/IP in the body10.x.x.x(push configured) omitspushentirelyMade with Cursor