Summary
Nezha Monitoring allows authenticated agents to forge monitoring results for services owned by other users due to missing authorization checks.
When an agent can submit data on behalf of unrelated services, attackers may corrupt monitoring dashboards, hide outages, or manipulate operational decisions.
Affected context
The issue arises in Nezha Monitoring deployments where multiple users or tenants register agents and services within the same monitoring instance.
In affected versions, the backend accepts monitoring results from authenticated agents without consistently verifying that the agent is authorized to report for a specific service.
This creates a cross-tenant trust problem whenever agents can reach the central Nezha server and submit status or performance data.
Exploit preconditions
- Attack surface: Monitoring data submission interface used by Nezha agents (typically HTTP/WebSocket or similar).
- Required access: Valid, authenticated agent credentials for any user within the Nezha instance.
- Trigger point: Submission of monitoring or service-check results, crafted to reference services belonging to other users.
- Why exploitation is possible: The server-side logic authenticates the agent but does not reliably enforce authorization tying that agent to a specific owner/service mapping, allowing one agent to impersonate another service's telemetry.
Why this happens
This vulnerability stems from a missing or incomplete authorization check on the server side when associating incoming monitoring results with specific services.
The system verifies that the submitting client is an authenticated agent, but it does not consistently ensure that this agent is permitted to report data for the targeted service identifier.
Conceptually, this maps to CWE-862: Missing Authorization, where access control is performed only at the authentication layer and not at the level of individual resources or actions.
The flawed pattern is trusting any authenticated agent as authorized for any service, instead of enforcing a strict agent-to-service ownership relation.
Potential impact
- Attackers can falsify uptime or health metrics for other users' services.
- Monitoring dashboards and alerts may be manipulated, causing hidden or falsely reported outages.
- Operations teams may make incorrect remediation decisions based on forged data.
- Incident response timelines can be delayed by misleading or noisy monitoring signals.
- Compliance or reporting based on monitoring logs may be rendered unreliable.
General mitigation guidance
Effective mitigation focuses on tightening authorization around telemetry submission paths and enforcing clear ownership boundaries:
- Enforce strong server-side authorization that binds each agent to a defined set of services it may report on.
- Treat service identifiers in incoming payloads as untrusted; derive the allowed service scope from the authenticated agent context rather than client-provided fields.
- Apply least privilege principles so that each agent has the minimal service scope necessary for its deployment.
- Add multi-tenant isolation controls, such as tenant or user scoping for all monitoring data and configuration operations.
- Implement defense-in-depth logging and anomaly detection to flag inconsistent or cross-tenant submissions, even when basic checks are in place.
How teams detect issues like this
Detection typically involves reviewing both code and runtime behavior for authorization gaps:
- Use static analysis or manual code review to locate endpoints where agents submit monitoring results and ensure resource-level authorization checks are present.
- Look for patterns where authenticated agent identifiers are accepted but not cross-checked with the target service or owner in server-side logic.
- Analyze logs for anomalies, such as a single agent reporting on multiple owners' services or sudden changes in reporting patterns.
- Incorporate security tests in CI/CD that attempt cross-tenant submissions to verify that the backend rejects unauthorized telemetry.
- Where feasible, deploy runtime application monitoring to alert on suspicious cross-user or cross-tenant interactions.

