chenBright opened a new pull request, #3525:
URL: https://github.com/apache/brpc/pull/3525
### What problem does this PR solve?
Issue Number: resolve
Problem Summary:
Authentication configured through `ServerOptions.auth` can be bypassed
entirely on a server that also sets `ServerOptions.internal_port`.
`VerifyHttpRequest()` returns true without checking any credential when a
builtin service is requested on `internal_port`. That verdict is not
per-request: `verify()` runs only for the first message of a connection
and the result latches the connection. Sending `GET /status` to
`internal_port` first therefore authenticates the connection, and
everything
sent next on it is dispatched without ever calling `verify()`.
### What is changed and the side effects?
Changed:
`internal_port` now carries builtin and Tabbed services only. Requests for
ordinary services are rejected with `EPERM` (HTTP 403) and must go to the
port passed to `Server::Start()`. With nothing but builtin services served
there, the latch has nothing left to unlock.
Side effects:
- Performance effects:
- Breaking backward compatibility:
---
### Check List:
- Please make sure your changes are compilable.
- When providing us with a new feature, it is best to add related tests.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]