Enforce internal_port gating of builtin services in pb protocols - #3511
Open
chenBright wants to merge 1 commit into
Open
Enforce internal_port gating of builtin services in pb protocols#3511chenBright wants to merge 1 commit into
chenBright wants to merge 1 commit into
Conversation
chenBright
force-pushed
the
fix_pb_builtin
branch
from
August 31, 2026 14:33
34d8d27 to
6a8ad05
Compare
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.
What problem does this PR solve?
Issue Number: resolve
Problem Summary:
ServerOptions.internal_portis documented to make builtin services (andTabbed services, see the comment on
internal_port) reachable only from theinternal port.
ServerOptions::security_mode()returns true once it is set.Only the http/h2 dispatch path actually enforced this. Every pb protocol
computed the same
security_modeflag but used it just for address obfuscationin
AppendServerIdentiy(), and had no check at all between method resolutionand
CallMethod(). Since builtin services share_method_mapwith userservices, they can be addressed by name over pb.
With
internal_portconfigured, a client on the public port can therefore reach builtinservices that the http path returns
403 Forbiddenfor on the very same server. Forexample,
brpc.varsdumps the full metrics set, andhotspotsis reachable the sameway.
Affected dispatch paths:
baidu_std,hulu_pbrpc,sofa_pbrpc, and allnshead-based pb protocols (
public_pbrpc,nshead_mcpack,nova_pbrpc,ubrpc2pb), which shareNsheadPbServiceAdaptor::ProcessNsheadRequest.What is changed and the side effects?
Changed:
Side effects:
Performance effects:
Breaking backward compatibility:
Check List: