Details
A scripted enumeration over public server IDs (a low-cardinality numeric space — typical nezha deployments have <1000 servers) trivially recovers the full set of hidden services that monitor any public server, along with their names and timing patterns.
Impact
Direct
Service names in nezha deployments are frequently descriptive of the underlying business asset they monitor: "Production CRM Monitor", "Internal Wiki Health", "Backup-Vault Connectivity", "Stripe Webhook Latency". The leak therefore:
- Discloses the existence and purpose of internal services that the owner explicitly hid from the public dashboard.
- Exposes timing/latency data for the monitored relationship between a private service and any public server it touches — sufficient for a competitor or attacker to infer business activity patterns, outage windows, and probable backend topology.
- Confirms presence/absence of a service ID via the second endpoint — an oracle that lets an unauthenticated visitor enumerate the service-id namespace and learn the deployment's service count and naming convention even when no public servers exist as enumeration vectors.
Indirect / second-order
- Affects multi-tenant public dashboards: nezha is frequently deployed as a public status page with a private "internal" tier in the same dashboard. The bypass collapses the privacy boundary between these tiers.
- Composability with prior advisories: the recent fixes for
GHSA-rxf6-wjh4-jfj6(cross-user trigger-task firing),GHSA-hvv7-hfrh-7gxj(WS server-stream cross-tenant leak), andGHSA-4g6j-g789-rghm(forged monitor results) all address the cross-tenant visibility model. This finding is a sibling that closes one more reader gap in the same model.
Suggested fix
Either of:
- Centralize the filter in `ServiceSentinel` — change
Get(id)andGetSortedList()to accept the*gin.Context(or a viewer context) and apply theEnableShowInServicefilter plus an admin-or-owner override. This guarantees every reader inherits the gate:
func (ss *ServiceSentinel) GetForViewer(c *gin.Context, id uint64) (*model.Service, bool) {
s, ok := ss.Get(id)
if !ok { return nil, false }
if !s.EnableShowInService && !callerIsAdminOrOwns(c, s) {
return nil, false
}
return s, true
}
- Recheck at every endpoint that emits service identity — add the EnableShowInService + ownership check at the top of
listServerServices,getServiceHistory, and anywhere elseGetSortedList()/Get()results flow to a response. More surgical but easier to miss next time.
Option (1) is symmetric with how userCanViewServer centralizes the server-visibility decision; the same pattern at the service layer would close this class once.