Repository navigation
2.5.3 — Button API hardening
Follow-up hardening to the 2.5.2 security release. Every change here is additive and opt-in — nothing breaks on upgrade.
Button API hardening
api.php is the one endpoint that runs commands without a login (the per-button hash is the credential), so it got three improvements:
- Off by default for new installs.
config.example.phpnow shipsbutton_apidisabled — enable it when you actually want it. Existing installs are deliberately left alone (the defaults backfill still enables it) so live automations keep working aftergit pull. Pinbutton_apiin yourconfig.phpto choose explicitly. - Send the key as a header. Query strings get written to web-server access logs, browser history and
Refererheaders. The key can now travel in a header instead:curl -H 'X-GumCP-Key: <32-char-hash>' http://<your-pi-ip>/GumCP/api.php
?hash=still works for existing automations. - Optional IP allow-list. Limit which addresses may call the API; anything else gets a
403before the hash is examined, and the attempt is logged:Matching uses the real peer address, so a spoofed$gumcp_api_allow_ips = ['192.168.1.50', '192.168.1.0/24']; // empty = no restriction
X-Forwarded-Forheader cannot bypass it. Behind a reverse proxy, the allowed address is the proxy's.
Documentation
- New README section “Limiting what GumCP can run” — a worked
/etc/sudoers.d/gumcpallow-list so the SSH user doesn't need blanketNOPASSWD: ALL, with an explicit note on what stops working (the free-text Actions box, arbitrary buttons, Docker control, the boot-file editor and the in-app updater).
Upgrading
cd /var/www/html/GumCP && sudo git pull origin masterNo configuration changes required. If you haven't upgraded through 2.5.2 yet, read its notes first — it fixes an unauthenticated RCE and requires configuring a login.