Commit Graph
11 Commits
Author SHA1 Message Date
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
uubulb 96bec45855 add zh_TW locale, rename ssl to tls 2024-11-01 14:32:55 +08:00
UUBulbandnap0o bf9c6d669a ddns: store configuation in database (#435)
* ddns: store configuation in database

Co-authored-by: nap0o <144927971+nap0o@users.noreply.github.com>

* feat: split domain with soa lookup

* switch to libdns interface

* ddns: add unit test

* ddns: skip TestSplitDomainSOA on ci

network is not steady

* fix error handling

* fix error handling

---------

Co-authored-by: nap0o <144927971+nap0o@users.noreply.github.com>
2024-10-17 21:03:03 +08:00
Mmx 256ca2465b fix: field name "VerifySSL" to "SkipVerifySSL" in Transport config (#305) 2023-12-06 09:35:38 +08:00
Mmx 9df97e2bdb Fix Coroutine Leaks and Proxy Handling in http.Client (#304)
* fix: builtin variable conflict

* feat: add pkg/utils/http HttpClientSkipTlsVerify HttpClient

* fix: realtime create http Transport

* fix: http keepalive connection may not reusable

* feat: allow http request use proxy from environment
2023-12-05 23:22:25 +08:00
naiba ad32426ab0 [agent] splitting the agent into separate repositories 2023-05-11 00:08:54 +08:00
naiba 0b84216cfb 🚸 优化NAT64机器取IP场景 2021-07-13 10:59:13 +08:00
naiba 1986297f99 ♻️ 优化 IPv4 / IPv6 地址判断 2021-06-22 17:28:28 +08:00
naiba 45585d13ff 🚸 优化 Agent 取 IP 2021-06-22 14:04:07 +08:00
naiba 8f59ee9430 ✏️ 2021-06-21 21:41:18 +08:00
naiba a9c7281af8 优化忽略规则配置和 Agent 获取 IP 2021-06-21 21:30:42 +08:00