Skip to content

fix(subscription): keep the server-only finalmask filter out of client configs - #1052

Merged
T3ST3ST3R0N merged 2 commits into
devfrom
fix/client-finalmask-filter
Oct 21, 2026
Merged

T3ST3ST3R0N merged 2 commits into
devfrom
fix/client-finalmask-filter

Conversation

@T3ST3ST3R0N

Copy link
Copy Markdown
Collaborator

Xray v26.10.21 added the finalmask type filter, which sets source-IP allow and block lists on tcp/udp masks. Only the server applies it. A host without its own finalmask inherits the inbound's, so Xray JSON subscriptions and the fm link parameter carried the filter. Clients older than v26.10.21 reject the whole config, and the admin's IP lists reached users.

  • Strip filter layers from the inbound finalmask where host client data is prepared, so every subscription format and the NATS host snapshot get the clean value. Other layers and keys keep their order, and an empty result is omitted. Host finalmasks are unchanged (their model does not accept filter).
  • Bump the NATS host snapshot key to state_v3, so upgraded installs rebuild instead of serving the old snapshot. fix(core): reload committed configs and preserve TLS defaults #1020 uses state_v2; a different value makes git report the overlap instead of merging two identical bumps silently.
  • The MASQUE xmux hint now names Xray 26.10.21 (26.10.10 and 26.10.17 were withdrawn upstream).

Tests: new tests/test_subscription_finalmask_filter.py (11 tests; 7 fail on dev). Root suite 711 passed, tests/api 476 passed, dashboard bun test 165 pass, tsc clean.

…t configs

Xray v26.10.21 added the tcp and udp finalmask type "filter" (allowed and
blocked source IPs). Only the server applies it. A host without its own
finalmask inherited the inbound's finalmask as is, so Xray JSON
subscriptions and the fm link parameter carried the filter layers: clients
older than v26.10.21 reject the whole config, and the admin's IP lists
reached users.

Drop filter layers (type matched case-insensitively, trimmed) from the
inbound finalmask where host client data is prepared, so every format and
the NATS host snapshot get the clean value. A list left empty is removed,
and a mask with nothing left becomes no finalmask. Everything else stays
in order. Host finalmasks are unchanged: their model rejects "filter".

Bump HostManager.STATE_CACHE_KEY to "state_v3" (open PR #1020 uses
"state_v2", and two PRs with the same value would merge silently and
leave the second without a refresh). With NATS enabled,
setup() loads the stored snapshot of prepared hosts instead of the DB, so
after the upgrade the old snapshot would keep serving the filter layers
until a host or core save.
Xray v26.10.10 and v26.10.17 were withdrawn (releases and tags deleted).
v26.10.21 is the first available release with MASQUE xmux, so the host
dialog hint now names it in all four locales. The ru and zh hints also
write the 1800-3000 range with a plain hyphen.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0474e1be-43ae-4f00-8141-c0113848b8ef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit da27446 into dev Oct 21, 2026
19 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the fix/client-finalmask-filter branch October 21, 2026 16:52
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
…rd main's decisions

B7-ADV2 B2-3, B2-4, B2-6, B2-10 and main's rulings of 2026-10-28.

Decisions (Owner decisions):
- 2026-10-28-main-reclassified, until 2026-11-08: the entries now
  classified security: yes where the fork is affected, each ported as
  the fork's own increment: PasarGuard#1053 59c3b62 (format_map; the fork's
  address allowlist also passes width specs), PasarGuard#947 eb30578
  (webhook URLs logged at app/jobs/send_notifications.py:45 and :47),
  PasarGuard#1052 da27446 (inbound finalmask filter lists reach clients),
  e538dc1 (removes upstream's address check; the fork keeps its
  own and caps format specs with PasarGuard#1053), PasarGuard#1060 e0bb112 (HWID
  registered before the 406), e6ca015 (certifi 2026.10.19,
  already on main as 1c20204), PasarGuard#1065 80d855f (bridge 0.9.4: a
  rejected user stalled the node queue, so removals never arrived),
  PasarGuard#1059 0155c0e (MySQL DATEDIFF ends reset cycles a day early),
  and [email protected].
- 2026-10-28-main-hint-waivers, until 2026-11-27: the nine Waived
  entries the keyword hint flags, now security: yes; the seven
  notifier-workflow commits are covered only while they touch nothing
  but .github/workflows/github-notifications-bot.yml (deleted by the
  fork in 535c1aa), and the two UNMERGED-WIP entries keep failing at
  once if upstream merges them.

Classifications (B2-4): every port-queue security: no reason was
re-read against its diff by six non-author readers (233 entries) and
rewritten to say why the change has no security effect instead of
paraphrasing the subject; 64 readers' flags were adjudicated: the
held telemt entries 0373f09, 35b493c and 84e5416, the
AmneziaWG branch (unchecked fields rendered into subscriber .conf
files), certifi 2026.10.19 and 2026.10.23, docker/login-action 4.7.0
and the telemt link and validation commits are security: yes; the
rest are no with a reason. 0097556 stays no with its reason.

Reasons (B2-10): every Held and Waived security: no entry gives its
reason; the gate's unreasoned count is 0.

aiohttp (B2-6): 3.14.4 fixes eight advisories against 3.14.3 (OSV
2026-10-29): three high, four moderate, one low; item 0b ports aiohttp
3.14.5 and yarl 1.25.1 with trailers.

Bridge waiver: PasarGuard#27 is a security fix, so the 0.9.4 waiver is
security = "yes" under 2026-10-28-main-reclassified, until unchanged.

Held: PasarGuard#1120 8e92a12 (sse-starlette 3.5.1, upstream dev head) and
the new upstream branch feat/gzip-compression (8f48cd7,
769c296, 420d094); .upstream-refs records both heads.

Gate at HEAD with --today 2026-10-29: OK, not at parity, 181 owed.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
…ords

B7-ADV2 B2-5 asks that the hint fire on PasarGuard#1053, PasarGuard#1060, PasarGuard#1052 and PasarGuard#947.
Reading the commit body catches PasarGuard#1060 ('escaped') and PasarGuard#947
('session'), but not PasarGuard#1053, whose body speaks of str.format_map, nor
PasarGuard#1052, whose subject keeps a server-only filter out of client configs.
The hint should also name format_map, server-only, and leak or expose
words.

RED on 4f040c5: all four cases fail.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
B7-ADV2 B2-5: with the commit body read, the hint now fires on PasarGuard#1053
('format_map'), PasarGuard#1060 ('escaped'), PasarGuard#1052 ('server-only') and PasarGuard#947
('session'). The RED test's fourth case, 'exposes', is dropped: on the
real ledger it flagged only API wording ('expose online_users',
'expose core_config_id') and would have turned a waived unmerged
feature into an error; 'leak' covers the exposure wording that matters.
The real panel gate at HEAD on 2026-10-29 shows no new note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant