Skip to content

safely detect global IPv4 and close socket properly and Harden get_subscription_payload against malformed tokens - #21

Closed
zZedix wants to merge 7 commits into
PasarGuard:nextfrom
zZedix:main
Closed

zZedix wants to merge 7 commits into
PasarGuard:nextfrom
zZedix:main

Conversation

@zZedix

@zZedix zZedix commented Oct 5, 2025

Copy link
Copy Markdown
Contributor

Improve public IP detection with multiple HTTP and socket fallbacks

Add layered fallback strategy using ipify, icanhazip, and ifconfig.io with IPv4 enforcement.
Falls back to UDP socket check when HTTP methods fail, and defaults to 127.0.0.1.
Ensures IPv6 is disabled for reliability and includes proper socket cleanup.

Improves resilience of get_subscription_payload by validating decoded token format
and preventing IndexError/ValueError for tampered or malformed tokens.

Added split and numeric validation for custom token decoding
Ensures consistent None return instead of 500 on invalid input
Keeps behavior unchanged for valid subscription tokens

zZedix added 7 commits October 5, 2025 01:52
- اضافه کردن لوگوی PasarGuard
- بهبود طراحی بصری با ایموجی‌ها و جداول
- ترجمه کامل به فارسی و انگلیسی
- ساختار بهتر و خوانایی بیشتر
- اضافه کردن بخش‌های جدید و بهبود یافته
- حل تضاد merge در README.md
- نگه‌داری نسخه بهبود یافته با لوگو و طراحی زیبا
- حل تضاد در فایل‌های utils
- Remove all Persian translations
- Keep only English content
- Maintain beautiful design and emojis
- Clean and professional English documentation
@zZedix zZedix closed this Oct 5, 2025
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
…ck mtg fork main

node_bridge_py PasarGuard#21 27be206 and PasarGuard#27 a01bdbb are security design ports now:
PasarGuard#27 kept a disabled, expired or deleted user active while the node
rejected another user, and PasarGuard#21's fence keeps a stale queued state from
overwriting a newer change. Each names the fork commits that carry it,
PasarGuard#27 as the chain of its three port commits, and every hunk of its own
change that is not on fork main as one block, with the later fork fix or
upstream commit that changed it.

mtg is tracked against fork main, the fork's default branch, where the
MTG lane merged upstream v2.3.0 as 06a89488146c, so the v2.3.0 commits
of the port queue, the accept-error security pair among them, are merged
with every line present. Fork master and the node's go.mod pin are
still 7d0f004a01dd. The branch-only upstream race fix 00a27e407da4
(PasarGuard#588) is recorded as superseded by fork commits 6e378787be50 and
e3e9542730f6, and its branch head is in the refs snapshot.

The subscription-template gap list says the fork page's one link, the
announcement link, is labelled Support.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 4, 2026
…the commits behind the bridge exceptions

Scripts fork main 66bbbd553ce5 carries upstream PasarGuard#41 4d481a8efd3c as a port
with changes (5d28a2b0afa2 through 0e02f9923f8f), so nothing of v0.1.10 or
v0.1.11 is owed. The PasarGuard#35 and bridge PasarGuard#21/PasarGuard#27 exceptions name, in full, the
fork commit that first broke each block, counts say they ignore indentation,
and the mtg v2.3.0 line says every hunk is present as it stands in v2.3.0.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 7, 2026
…k main 8cf768bfb6dd

The node_bridge_py ledger is re-checked against fork main 8cf768bfb6dd and upstream
main c5632b65a10a (tag v0.10.0). The PasarGuard#21 and PasarGuard#27 security rows name every hunk
the fork's later sync fixes changed, with today's counts; 0b3de16 gets its row;
779f9b9, 80f81ad, 9cac8cd and c5632b6 are owed to round 11 lane BRIDGE-PORT;
cited line numbers and the fork label follow fork main; the refs snapshot records
upstream main, v0.9.5 and v0.10.0.
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