Skip to content

fix(linux): relay bind, config perms, GUI update security - #212

Open
1rhino2 wants to merge 6 commits into
InterceptSuite:devfrom
1rhino2:security/linux-relay-config-update
Open

fix(linux): relay bind, config perms, GUI update security#212
1rhino2 wants to merge 6 commits into
InterceptSuite:devfrom
1rhino2:security/linux-relay-config-update

Conversation

@1rhino2

@1rhino2 1rhino2 commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Three Linux security fixes (+ update feed alignment):

  1. Relay bind: TCP/UDP relay ports 34010 and 34011 used INADDR_ANY. Now 127.0.0.1 only, same idea as the other platforms.

  2. Config perms: proxy creds in /etc/proxybridge/config.ini were default world readable. Dir 0700, file 0600, chmod on load for old installs.

  3. GUI update: used to curl deploy.sh from raw github and run bash as root. Now reads https://download.interceptsuite.com/proxybridge.json (linux entry, same feed as mac/windows) and opens the release/download url in the browser via gtk_show_uri_on_window. No script download/exec.

Closes #211

Test plan

  • build linux gui + core on ubuntu/debian
  • ss -lntp shows 127.0.0.1:34010 and :34011 only
  • save settings, stat -c %a /etc/proxybridge/config.ini is 600
  • About -> Check for Updates hits proxybridge.json, opens browser on newer linux version, no deploy.sh exec

1rhino2 added 5 commits July 31, 2026 18:48
TCP and UDP relay sockets used INADDR_ANY, exposing ports 34010/34011 on all interfaces. Match the documented localhost-only relay posture.
Store credentials in /etc/proxybridge with mode 0600 and directory 0700. Tighten permissions on load for legacy installs.
Stop downloading and executing deploy.sh from raw.githubusercontent.com as root. Open the official GitHub release page instead and fetch release metadata without a shell.
less helper boilerplate in gui update path, casual comments
Match mac/windows feed instead of GitHub releases/latest, and open
the linux release/download url in the browser (no deploy.sh).
Copilot AI review requested due to automatic review settings August 2, 2026 05:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens Linux security posture in ProxyBridge by limiting relay exposure to loopback, hardening config file permissions under /etc/proxybridge, and replacing the GUI updater’s script-download-and-exec flow with a safer update-feed lookup that opens a browser URL.

Changes:

  • Bind TCP and UDP relay listeners to 127.0.0.1 instead of INADDR_ANY.
  • Create/repair /etc/proxybridge permissions (0700) and aim for config file permissions (0600), including a chmod on load for older installs.
  • Replace the Linux GUI update mechanism with a JSON feed fetch and gtk_show_uri_on_window() to open release/download URLs (no script execution).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Linux/src/ProxyBridge.c Binds relay sockets to loopback to prevent LAN exposure.
Linux/gui/main.c Reworks GUI update check to use the shared update feed and open a browser instead of executing scripts.
Linux/gui/gui_config.c Hardens config directory/file permissions and attempts remediation for existing installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Linux/gui/gui_config.c
Comment on lines +19 to 29
int cfg_fd = open(CONFIG_PATH, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (cfg_fd < 0) {
printf("failed to save config to %s\n", CONFIG_PATH);
return;
}
FILE *f = fdopen(cfg_fd, "w");
if (!f) {
close(cfg_fd);
printf("failed to save config to %s\n", CONFIG_PATH);
return;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ye good catch. added fchmod(cfg_fd, 0600) right after open so existing files get tightened on save too.

Comment thread Linux/gui/main.c
Comment on lines +40 to +57
static char *extract_platform_block(const char *json, const char *platform) {
char needle[64];
snprintf(needle, sizeof(needle), "\"%s\"", platform);
char *p = strstr(json, needle);
if (!p) return NULL;
char *brace = strchr(p, '{');
if (!brace) return NULL;
int depth = 0;
for (char *q = brace; *q; q++) {
if (*q == '{') depth++;
else if (*q == '}') {
depth--;
if (depth == 0)
return g_strndup(brace, (gsize)(q - brace + 1));
}
}
return NULL;
}

@1rhino2 1rhino2 Aug 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. now it only takes "linux": as a key (skips string values) and keeps the pointers const.

fchmod on save so old 0644 configs get 0600 immediately, and only parse
linux object keys (key:) for the update feed.
@1rhino2

1rhino2 commented Aug 2, 2026

Copy link
Copy Markdown
Author

addressed both copilot notes:

  • save_config: fchmod(cfg_fd, 0600) right after open so existing 0644 files get tightened on save, not only on create / next load
  • extract_platform_block: only accepts "linux": as a key (skip string values), and kept the pointers const

pushed on this branch.

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.

2 participants