1 line
4.6 KiB
JSON
1 line
4.6 KiB
JSON
{"id": "GHSA-w4g9-mxgg-j532", "cve": "CVE-2026-46717", "repo": "nezhahq/nezha", "cwes": ["CWE-863", "CWE-918"], "vuln_files": ["model/notification.go", "model/notification_test.go"], "duration_sec": 104, "error": null, "strict": false, "lenient": false, "findings_scored": [{"fileMatch": false, "lineProx": false, "cweMatch": false, "hit": false, "title": "Nil-pointer dereference / division-by-zero in alert cycle-transfer rule evaluation (DoS)", "file": "model/rule.go", "line": 187, "cwe": "CWE-476"}, {"fileMatch": false, "lineProx": false, "cweMatch": false, "hit": false, "title": "Panic on slices.Max over empty slice for gpu_max / temperature_max rules (DoS)", "file": "model/rule.go", "line": 70, "cwe": "CWE-248"}, {"fileMatch": true, "lineProx": false, "cweMatch": false, "hit": false, "title": "Unescaped notification template substitution enables JSON/body injection in outbound notifications", "file": "model/notification.go", "line": 79, "cwe": "CWE-116"}], "n_findings": 3, "findings": [{"title": "Nil-pointer dereference / division-by-zero in alert cycle-transfer rule evaluation (DoS)", "file": "model/rule.go", "line": 187, "cwe": "CWE-476", "vuln_class": "dos", "severity": "high", "description": "Rule.CycleStart is a *time.Time tagged validate:\"optional\" and Rule.CycleInterval is an unvalidated uint64; both are populated directly from the alert-rule API form (AlertRuleForm.Rules -> Rule) and persisted/loaded via AlertRule.RulesRaw JSON (un)marshaling with no validation. In Rule.Snapshot, for any rule whose Type ends in '_cycle' (IsTransferDurationRule()==true), the block at lines 141-163 ALWAYS calls u.GetTransferDurationStart() and u.GetTransferDurationEnd() at lines 161-162 \u2014 independently of the 'if u.CycleInterval != 0' guards used earlier (lines 97/104/111). GetTransferDurationStart() begins with 'startTime := *u.CycleStart' (line 187): if cycle_start was omitted in the rule JSON, this dereferences a nil *time.Time and panics. The same functions also compute 'interval := 3600 * int64(u.CycleInterval)' and divide by it in the default/hour branch (lines 217/257); with cycle_interval==0 this is an integer division by zero panic. Either panic aborts the periodic alert-evaluation goroutine that runs Snapshot for every monitored server, taking down monitoring/alerting (availability) for the whole dashboard.", "poc": "As an authenticated user create/save an alert rule with a rule object: {\"rules\":[{\"type\":\"transfer_in_cycle\",\"max\":1}]} (no cycle_start, cycle_interval=0, cycle_unit unset). On the next alert tick the server evaluates Rule.Snapshot -> GetTransferDurationStart() -> '*u.CycleStart' nil dereference panic (and/or 3600*0 division-by-zero in the default unit branch), crashing the alerting loop.", "confidence": 0.78}, {"title": "Panic on slices.Max over empty slice for gpu_max / temperature_max rules (DoS)", "file": "model/rule.go", "line": 70, "cwe": "CWE-248", "vuln_class": "dos", "severity": "medium", "description": "In Rule.Snapshot, the 'gpu_max' branch calls slices.Max(server.State.GPU) (line 70) and the 'temperature_max' branch calls slices.Max(temp) (line 136). Go's slices.Max panics when given a zero-length slice. server.State.GPU and Temperatures originate from agent-reported HostState (PB2State) and are not guaranteed non-empty; an agent reporting no GPU/temperature data combined with an admin-configured 'gpu_max'/'temperature_max' alert rule causes slices.Max to panic and crash the alert-evaluation goroutine.", "poc": "Configure an alert rule {\"rules\":[{\"type\":\"gpu_max\",\"max\":1}]} for a server whose agent reports no GPU data (empty GPU slice). On evaluation, slices.Max([]) panics.", "confidence": 0.5}, {"title": "Unescaped notification template substitution enables JSON/body injection in outbound notifications", "file": "model/notification.go", "line": 79, "cwe": "CWE-116", "vuln_class": "info-disclosure", "severity": "low", "description": "reqBody()'s Form branch (line 79) calls replaceParamsInString with a nil mod function, so attacker-influenced server fields (e.g. Server.Name, public note, agent-reported metrics) are substituted into form/body parameters without escaping. Combined with attacker-controlled notification URL/headers (setRequestHeader sets arbitrary headers, Send may skip TLS verification), this allows content injection into outbound requests, though it requires notification configuration privileges.", "poc": "Set a server name containing form-breaking characters and a Form-type notification whose body references #SERVER.NAME#; the value is inserted unescaped into the urlencoded body.", "confidence": 0.2}], "transcript": ""} |