mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(node): keep master requests on the node they were sent to
The master's node clients followed redirects to any host, presenting the same panel-wide credentials (the mTLS client certificate) and replaying the request there, so one node could have the master push to another. Node clients and the certificate-pin probe now stop at a redirect off the original host:port and report the 3xx as the node's answer. The probe change is wiring; TestNodeClientsDoNotFollowARedirectToAnotherHost covers the guard.
This commit is contained in:
@@ -90,6 +90,8 @@ func (s *NodeService) FetchCertFingerprint(ctx context.Context, n *model.Node) (
|
||||
DialContext: netsafe.SSRFGuardedDialContext,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // lgtm[go/disabled-certificate-check]
|
||||
},
|
||||
// The pin must be the certificate of the host asked, not of wherever it redirects.
|
||||
CheckRedirect: runtime.NoCrossHostRedirect,
|
||||
}
|
||||
defer client.CloseIdleConnections()
|
||||
resp, err := client.Do(req)
|
||||
|
||||
Reference in New Issue
Block a user