<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Nezha — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/nezha/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Sat, 23 May 2026 00:19:38 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/nezha/feed.xml" rel="self" type="application/rss+xml"/><item><title>Nezha Monitoring Cross-Tenant RCE via Cron Task Injection</title><link>https://feed.craftedsignal.io/briefs/2026-05-nezha-rce/</link><pubDate>Sat, 23 May 2026 00:19:38 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-nezha-rce/</guid><description>A RoleMember in Nezha monitoring dashboard can achieve cross-tenant remote code execution by injecting arbitrary commands into cron tasks due to insufficient authorization checks, impacting all monitored hosts in the deployment.</description><content:encoded><![CDATA[<p>The Nezha monitoring dashboard is vulnerable to a cross-tenant RCE. A <code>RoleMember</code> (Role==1), even one self-registered via OAuth2, can exploit insufficient authorization checks in the cron task creation process (<code>POST /api/v1/cron</code> and <code>PATCH /api/v1/cron/:id</code>). The vulnerability stems from the cron routes being handled by <code>commonHandler</code> instead of <code>adminHandler</code>, and a vacuous-true bypass in the permission check for cron creation. By creating a scheduled cron task with <code>Cover=CronCoverAll, Servers=[]</code> and an arbitrary <code>Command</code>, the attacker can execute commands on every server in the global <code>ServerShared</code> map, which includes servers belonging to other tenants. This allows any <code>RoleMember</code> to gain pre-validated RCE on every Nezha-monitored host in the deployment. Affected versions include commit <code>50dc8e660326b9f22990898142c58b7a5312b42a</code> and earlier on the <code>master</code> branch.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains <code>RoleMember</code> access to the Nezha dashboard, either through admin-granted credentials or self-registration via OAuth2 if enabled.</li>
<li>Attacker obtains a JWT token by authenticating against the <code>/api/v1/login</code> endpoint using their <code>RoleMember</code> credentials.</li>
<li>Attacker creates a webhook notification via <code>POST /api/v1/notification</code> pointing to an attacker-controlled server (e.g., <code>https://attacker.example.com/exfil</code>).</li>
<li>Attacker creates a notification group via <code>POST /api/v1/notification-group</code> and associates the newly created webhook notification with this group.</li>
<li>Attacker crafts a malicious cron task payload using <code>POST /api/v1/cron</code> with <code>servers: []</code>, <code>cover: 1</code>, <code>push_successful: true</code>, and an arbitrary command (e.g., <code>id; hostname; cat /etc/shadow</code>) to be executed on all monitored servers. The <code>notification_group_id</code> field is set to the ID of the attacker&rsquo;s notification group.</li>
<li>The cron task is scheduled and, upon execution, the crafted command is sent to all monitored Nezha agents.</li>
<li>Each agent executes the command and sends the output back to the Nezha dashboard.</li>
<li>The Nezha dashboard, due to the <code>push_successful: true</code> setting, pushes the command output to the attacker-controlled webhook, allowing the attacker to collect sensitive information from all monitored hosts.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows any <code>RoleMember</code> to achieve cross-tenant RCE on every host monitored by the Nezha dashboard. This can lead to full compromise of all monitored systems, including data exfiltration, privilege escalation, and disruption of services. The vulnerability affects all deployments where <code>RoleMember</code> accounts are enabled, including those with OAuth2 self-registration. The impact is especially severe as the Nezha agent typically runs as root.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately switch <code>/cron</code> write operations to <code>adminHandler</code> to restrict cron task creation and modification to administrators, mitigating unauthorized command injection (reference: <code>cmd/dashboard/controller/controller.go:131-135</code>).</li>
<li>Implement a per-server permission gate in the <code>CronTrigger</code> function to ensure that cron tasks are only executed on servers owned by the user or an administrator. This adds an additional layer of security (reference: <code>service/singleton/crontask.go:133-181</code>).</li>
<li>Reject cron task creation with empty <code>Servers</code> lists when <code>Cover=CronCoverAll</code> to prevent unrestricted command execution across all hosts (reference: <code>cmd/dashboard/controller/cron.go:45-85</code>).</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>rce</category><category>privilege-escalation</category><category>cron</category><category>authorization</category><category>nezha</category></item><item><title>Nezha Monitoring RoleMember SSRF with Full Response Body Reflection</title><link>https://feed.craftedsignal.io/briefs/2026-05-nezha-ssrf/</link><pubDate>Sat, 23 May 2026 00:11:36 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-nezha-ssrf/</guid><description>Nezha Monitoring is vulnerable to a server-side request forgery (SSRF) vulnerability, where a low-privilege RoleMember user can call notification routes and send HTTP requests to a user-controlled URL, with the entire response body reflected back to the caller, potentially exposing intranet resources and causing denial of service.</description><content:encoded><![CDATA[<p>Nezha Monitoring is affected by a server-side request forgery (SSRF) vulnerability that allows a low-privileged <code>RoleMember</code> user (Role==1) to perform actions normally restricted to <code>RoleAdmin</code>. The vulnerability resides in the notification routes <code>POST /api/v1/notification</code> and <code>PATCH /api/v1/notification/:id</code>, which are accessible to <code>RoleMember</code> users due to being wired through <code>commonHandler</code> instead of <code>adminHandler</code>. By crafting malicious HTTP requests to user-controlled URLs via these routes, attackers can force the Nezha dashboard&rsquo;s hub to send requests to internal resources. The entire response body, without any size limitation, is then reflected back to the attacker, enabling the exposure of sensitive intranet data and potential denial-of-service (DoS) attacks by targeting large internal files. The vulnerability exists in versions up to commit <code>50dc8e660326b9f22990898142c58b7a5312b42a</code> on the <code>master</code> branch.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker obtains a valid <code>RoleMember</code> account, likely through legitimate registration or compromise.</li>
<li>Attacker crafts a malicious HTTP POST request to <code>/api/v1/notification</code> or <code>PATCH /api/v1/notification/:id</code>.</li>
<li>The request includes a JSON payload containing a user-controlled <code>URL</code> parameter pointing to an internal resource (e.g., <code>http://192.168.1.1/admin/index.html</code> or <code>http://169.254.169.254/latest/meta-data/iam/security-credentials/</code>).</li>
<li>The <code>NotificationServerBundle.Send()</code> function is called, which uses either <code>utils.HttpClient</code> or <code>utils.HttpClientSkipTlsVerify</code> (depending on the <code>VerifyTLS</code> setting) to send the request. Critically, the request is sent synchronously, and <code>VerifyTLS</code> can be set to false to bypass TLS certificate validation.</li>
<li>The target internal resource responds to the request. If the response status code is not in the 200-299 range, the entire response body is read via <code>io.ReadAll</code> and included in an error message.</li>
<li>The error message, containing the full response body of the internal resource, is returned to the attacker via <code>newErrorResponse</code> in a JSON response.</li>
<li>The attacker parses the JSON response to extract the reflected content of the internal resource.</li>
<li>If the attacker targets a large internal file, the dashboard may experience a denial-of-service due to excessive memory consumption by <code>io.ReadAll</code>.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SSRF vulnerability allows a <code>RoleMember</code> to read the contents of internal web pages, potentially exposing sensitive information like API keys, configuration details, or internal application data. The ability to disable TLS verification expands the scope of attack to internal HTTPS endpoints. Furthermore, an attacker can trigger a denial-of-service (DoS) by targeting large internal files, causing the dashboard server to consume excessive memory. The vulnerability is rated as medium severity with a CVSS score of 6.4, considering the low privileges required and potential for limited data exposure and service disruption.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately apply the suggested fix by switching the <code>/notification</code> routes to use <code>adminHandler</code> to restrict access to administrators only. This mitigation directly addresses the root cause by preventing <code>RoleMember</code> users from accessing the vulnerable endpoints (<code>cmd/dashboard/controller/controller.go:121-122</code>).</li>
<li>Implement SSRF hardening measures in the <code>NotificationServerBundle.Send()</code> function as suggested in the advisory. This should include validating the target URL, resolving the host IP address, and enforcing HTTP(S) schemes to prevent requests to arbitrary protocols.</li>
<li>Cap the response body size using <code>io.LimitReader(resp.Body, 4096)</code> within the <code>NotificationServerBundle.Send()</code> function to mitigate the DoS risk associated with reading large internal files (<code>model/notification.go:113-159</code>).</li>
<li>Deploy the provided Sigma rule <code>Detect Nezha Monitoring SSRF Attempt via Notification API</code> to identify attempts to exploit this vulnerability by monitoring requests to the <code>/api/v1/notification</code> endpoint with suspicious URLs.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>ssrf</category><category>nezha</category><category>vulnerability</category></item></channel></rss>