Commit Graph
3997 Commits
Author SHA1 Message Date
naibaandnaiba/CloudCode 097d4f7382 fix(controller): hide foreign server IDs from forceUpdateServer response
The previous loop only checked ownership inside the
\`server != nil && server.TaskStream != nil\` branch. A foreign online
server returned permission denied for the whole batch while foreign
offline / unknown IDs silently went into the Offline bucket — the
response-shape delta let a RoleMember enumerate other users' online
server IDs by submitting them in batches.

Drop both foreign and unknown IDs silently into the Offline bucket
(without dispatching the upgrade task) so the response is indistinguishable
across those three states.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:16:59 +00:00
naibaandnaiba/CloudCode 710a2c731c fix(controller): hide foreign server IDs from forceUpdateServer response
The previous loop only checked ownership inside the
\`server != nil && server.TaskStream != nil\` branch. A foreign online
server returned permission denied for the whole batch while foreign
offline / unknown IDs silently went into the Offline bucket — the
response-shape delta let a RoleMember enumerate other users' online
server IDs by submitting them in batches.

Drop both foreign and unknown IDs silently into the Offline bucket
(without dispatching the upgrade task) so the response is indistinguishable
across those three states.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:16:59 +00:00
naibaandnaiba/CloudCode 36297699f5 fix(rpc): bind io_stream sessions to creator to prevent terminal/fm hijack
createTerminal and createFM correctly check server ownership before
issuing a stream UUID, but terminalStream and fmStream only verified
that the UUID existed. Any authenticated user holding a valid stream
UUID could attach to it, gaining the original creator's live shell or
file-manager session — and the UUID is exposed via URL path (referer
leaks, access logs, browser history, frontend error reporters).

Bind the creator user ID into ioStreamContext at CreateStream time,
expose StreamOwnership and IsStreamAuthorizedForUser, and check
ownership in terminalStream/fmStream before the WebSocket upgrade so a
rejected attempt does not tear down the legitimate stream via defer.

NAT streams are also routed through CreateStream(_, 0); they are not
reachable from /ws/terminal or /ws/file so a sentinel user ID is fine.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:16:40 +00:00
naibaandnaiba/CloudCode 6661d6a7fc fix(rpc): bind io_stream sessions to creator to prevent terminal/fm hijack
createTerminal and createFM correctly check server ownership before
issuing a stream UUID, but terminalStream and fmStream only verified
that the UUID existed. Any authenticated user holding a valid stream
UUID could attach to it, gaining the original creator's live shell or
file-manager session — and the UUID is exposed via URL path (referer
leaks, access logs, browser history, frontend error reporters).

Bind the creator user ID into ioStreamContext at CreateStream time,
expose StreamOwnership and IsStreamAuthorizedForUser, and check
ownership in terminalStream/fmStream before the WebSocket upgrade so a
rejected attempt does not tear down the legitimate stream via defer.

NAT streams are also routed through CreateStream(_, 0); they are not
reachable from /ws/terminal or /ws/file so a sentinel user ID is fine.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-18 15:16:40 +00:00
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
naibaandnaiba/CloudCode e7c2e453c0 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
naibaandnaiba/CloudCode b2294f11dd fix(ws): scope server stream visibility to viewer ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 03:41:28 +00:00
naibaandnaiba/CloudCode 05e5da2535 fix(ws): scope server stream visibility to viewer ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 03:41:28 +00:00
naibaandnaiba/CloudCode 2b6a1430ff chore(deps): upgrade go modules to latest
Bumps direct deps: VictoriaMetrics v1.134.0 -> v1.143.0,
gin-contrib/pprof v1.5.3 -> v1.5.4, knadh/koanf/v2 v2.3.3 -> v2.3.4,
libdns/he v1.2.1 -> v1.2.2, tidwall/gjson v1.18.0 -> v1.19.0,
golang.org/x/crypto v0.49.0 -> v0.51.0,
golang.org/x/net v0.52.0 -> v0.54.0,
google.golang.org/grpc v1.79.3 -> v1.81.1, plus transitive updates.

VictoriaMetrics v1.143.0 requires go >= 1.26.3, so the go directive
is bumped from 1.26 to 1.26.3.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 02:40:09 +00:00
naibaandnaiba/CloudCode e1244ca372 chore(deps): upgrade go modules to latest
Bumps direct deps: VictoriaMetrics v1.134.0 -> v1.143.0,
gin-contrib/pprof v1.5.3 -> v1.5.4, knadh/koanf/v2 v2.3.3 -> v2.3.4,
libdns/he v1.2.1 -> v1.2.2, tidwall/gjson v1.18.0 -> v1.19.0,
golang.org/x/crypto v0.49.0 -> v0.51.0,
golang.org/x/net v0.52.0 -> v0.54.0,
google.golang.org/grpc v1.79.3 -> v1.81.1, plus transitive updates.

VictoriaMetrics v1.143.0 requires go >= 1.26.3, so the go directive
is bumped from 1.26 to 1.26.3.

Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 02:40:09 +00:00
naibaandnaiba/CloudCode 854e2edf17 chore: bump admin frontend to v2.0.7
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 9f21db2dc6 chore: bump admin frontend to v2.0.7
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 7061651587 test: cover multi-user permission boundaries
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode c0e2470a9d test: cover multi-user permission boundaries
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 2573ba7522 fix(controller): restrict waf and online-user listings to admins
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 530722293f fix(controller): restrict waf and online-user listings to admins
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 0ca7ee38c0 fix(controller): filter listing endpoints by ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode acc2b63ce2 fix(controller): filter listing endpoints by ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 2a65a7db80 fix(controller): enforce ownership on notification group, NAT server, and batch move
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode a5995ce045 fix(controller): enforce ownership on notification group, NAT server, and batch move
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 58f98db1a0 fix(controller): validate trigger task ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode 423175a425 fix(controller): validate trigger task ownership
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode e38a0ef469 fix(cron): restrict task delivery by owner
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode d7526351cf fix(cron): restrict task delivery by owner
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode c4bea1ffd3 fix(notification): harden webhook request handling
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
naibaandnaiba/CloudCode d06d539d34 fix(notification): harden webhook request handling
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-05-17 10:24:19 +08:00
Bot f3dded3186 feat: separate expiry notification days and refactor TG bot interactive logic 2026-05-13 00:52:36 +08:00
Bot 3d00f09493 feat: implement self-hosted scripts and agent binary proxy with tar.gz conversion 2026-05-11 17:55:30 +08:00
uubulb 3e889dc3d9 fix(OnUserDelete): only delete current iterated user from db 2026-05-09 12:38:39 +08:00
uubulb 85b0dd2992 fix(OnUserDelete): only delete current iterated user from db 2026-05-09 12:38:39 +08:00
Bot 3319d7344f feat: rewrite notification system and telegram interactive bot 2026-04-28 00:04:29 +08:00
Bot c606fd99f6 chore: optimize and fix github actions (cleanup, CI fixes, security scanner tuning) 2026-04-26 22:25:00 +08:00
Bot b4a0641177 feat: use RDAP as primary domain info source for higher reliability 2026-04-16 23:18:42 +08:00
Bot a3e2b2edba fix: resolve import errors and clarify whois error messages 2026-04-16 23:16:30 +08:00
Bot 3d19be657d feat: automated renewal price sync via nazhumi API 2026-04-16 23:11:30 +08:00
Bot 5dfc049121 feat: implement automated WHOIS sync for domains 2026-04-16 23:08:50 +08:00
Bot 5493f5c32f feat: add native Telegram notification provider 2026-04-16 21:43:44 +08:00
Bot dc58e84946 fix: automatic theme switching and extended expiry notifications 2026-04-16 21:40:26 +08:00
Bot 3d849b4b43 feat: implement VPS/Domain expiry notifications and native SMTP support 2026-04-16 21:36:49 +08:00
Bot bc32f8fce4 feat: add support for custom branding and background settings in Config 2026-04-16 17:18:48 +08:00
Bot 23ece08076 Remove WebSocket SSH terminal API implementation 2026-04-16 16:21:24 +08:00
Buriburizaemon 2ad62df7b3 Merge upstream/master and resolve conflicts 2026-04-16 11:58:30 +08:00
naiba 027cb5f4b7 chore: upgrade frontend 2026-04-05 10:00:11 +08:00
naiba 50dc8e6603 chore: upgrade frontend 2026-04-05 10:00:11 +08:00
naibaandnaiba/CloudCode 241506e390 chore: bump Go to 1.26, update dependencies and frontend templates
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-03-20 11:23:03 +00:00
naibaandnaiba/CloudCode 9acffc11f6 chore: bump Go to 1.26, update dependencies and frontend templates
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
2026-03-20 11:23:03 +00:00
naiba 5c07c3befb Merge pull request #1177 from nezhahq/dependabot/go_modules/google.golang.org/grpc-1.79.3
chore(deps): bump google.golang.org/grpc from 1.76.0 to 1.79.3
2026-03-20 18:39:37 +08:00
naiba 4e9513501f Merge pull request #1177 from nezhahq/dependabot/go_modules/google.golang.org/grpc-1.79.3
chore(deps): bump google.golang.org/grpc from 1.76.0 to 1.79.3
2026-03-20 18:39:37 +08:00
dependabot[bot] 87bf588a10 chore(deps): bump google.golang.org/grpc from 1.76.0 to 1.79.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.76.0 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.76.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 02:27:20 +00:00
dependabot[bot] 91a636ce25 chore(deps): bump google.golang.org/grpc from 1.76.0 to 1.79.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.76.0 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.76.0...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-19 02:27:20 +00:00