naibaandnaiba/CloudCode ea7ad67f03 fix(ddns): apply SSRF defense to webhook provider
GHSA-6x26-5727-rrm9: a low-privilege member could point a DDNS webhook
at internal or loopback hosts and the dashboard would dial them with the
unrestricted utils.HttpClient.

Extract the notification SSRF defenses (CIDR blocklist, IP-pin DialContext,
SNI preservation, redirect rejection) into reusable helpers in pkg/utils
(NewRestrictedHTTPClient / ResolveAllowedHTTPURL / buildRestrictedHTTPClient)
and route the DDNS webhook through the same path. Replace the notification
inline implementation with a thin wrapper to keep behaviour identical.

Side improvements collected by the refactor:
- prepareRequest now resolves DNS once and returns the paired client, so
  the dialer's pinned IP and the validated URL stay in sync (no more
  double resolution between prepareRequest and SetRecords).
- response body is drained and closed.
- HttpClient / HttpClientSkipTlsVerify are explicitly tagged unsafe for
  attacker-controlled URLs.

Tests cover: hermetic SNI preservation, redirect rejection, dial pin to
the vetted IP, the full blocked-CIDR list at the webhook entry point,
and the verifyTLS↔skipVerifyTLS inversion in the notification wrapper.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:14:27 +00:00
2025-02-28 22:19:57 +08:00
2025-02-09 14:39:12 +08:00
2025-03-22 22:44:25 +08:00
2021-01-30 11:22:59 +08:00
2026-02-15 13:13:33 +08:00
2021-03-22 17:41:38 +08:00
2026-03-01 11:33:11 +08:00
2022-04-18 10:47:29 +08:00



LOGO designed by 熊大 .

GitHub release (with filter)   Translation status

:trollface: Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.

Supports monitoring system status, HTTP (SSL certificate change, upcoming expiration, expired), TCP, Ping and supports push alerts, run scheduled tasks and web terminal.

>> Telegram Channel: 哪吒监控(中文通知频道)
>> Telegram Group: Nezha Monitoring Global (English Only), 哪吒监控(中文群组)

>> Use Cases | 我们的用户 (Google)

User Guide

Contributing

Translation

Translation status

Is Nezha not in your language, or the translation is incorrect or incomplete? Get involved in the translations on Hosted Weblate.

Screenshots

用户前台 @hamster1963 管理后台 @nezhahq
user admin
hamster1963/nezha-dash nezhahq/admin-frontend

add your theme to service/singleton/frontend-templates.yaml

Contributors

naiba

UUBulb Akkia 卖女孩的小火柴 nap0o 黑歌 xykt Weblate (bot) MikoyChinese JackieSung4ev Kris Lemoe spiritlhl 刘颜溪 CosmosZ-code Ko no dio Kris Mmx233 rootmelo92118 Moraxyc Xu 1ridic 仓鼠 zhucaidan Sean lyj fscarmen windingFlame JSker9 Hsukqi Lee Darc Z. Creling Core F adminsama Acgpiano eya46 guoyongchang hiDandelion honeok IYUANWEIZE igophper lvyaoting quanljh unclezs 缘生 严浩 凌 榆木 93 Tony TomyJan Tater Li Tao Chen Spetrum NikoCat233 Nanjing Hopefun Network Technology Co. Ltd. Mingzhuo Yin Martijn Lindeman Leon KorenKrita Ian Li YiPing Zhang Esdese :D Coming

Special Thanks

  • IPInfo for providing an accurate GeoIP Database.

Star History

Star History Chart

S
Description
No description provided
Readme Apache-2.0
57 MiB
Languages
Go 99.3%
Shell 0.5%
PowerShell 0.2%