fix(linux): relay bind, config perms, GUI update security - #212
Conversation
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).
There was a problem hiding this comment.
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.1instead ofINADDR_ANY. - Create/repair
/etc/proxybridgepermissions (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.
| 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; | ||
| } |
There was a problem hiding this comment.
ye good catch. added fchmod(cfg_fd, 0600) right after open so existing files get tightened on save too.
| 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; | ||
| } |
There was a problem hiding this comment.
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.
|
addressed both copilot notes:
pushed on this branch. |
Summary
Three Linux security fixes (+ update feed alignment):
Relay bind: TCP/UDP relay ports 34010 and 34011 used
INADDR_ANY. Now127.0.0.1only, same idea as the other platforms.Config perms: proxy creds in
/etc/proxybridge/config.iniwere default world readable. Dir0700, file0600, chmod on load for old installs.GUI update: used to curl
deploy.shfrom raw github and run bash as root. Now readshttps://download.interceptsuite.com/proxybridge.json(linux entry, same feed as mac/windows) and opens the release/download url in the browser viagtk_show_uri_on_window. No script download/exec.Closes #211
Test plan
ss -lntpshows127.0.0.1:34010and:34011onlystat -c %a /etc/proxybridge/config.iniis600proxybridge.json, opens browser on newer linux version, nodeploy.shexec