fix(dev): bind dev Postgres to loopback and reject public LAN IP #398
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dev-db-loopback-bind"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The dev stack discovered the host br0 IPv4 in
just devand published ports to it. On this host br0 carries a public address, so postgres:postgres was exposed to the internet and compromised by the PG_MEM/"wog" Postgres botnet (rogue superuser plus RCE via a SQL system() function that downloaded a miner). This hardens the dev stack so a database can never be published off-box.compose.dev.yml now hardcodes the Postgres host publish to 127.0.0.1. The database is reached in-network as postgres:5432; only host-side sqlx-cli uses the loopback port, so nothing external is lost.
justfile bind-IP discovery now keeps only RFC1918 (private) addresses and falls back to 127.0.0.1 with a warning when the only candidate is public, so app ports are never published on a public interface.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Superseded by #399. This branch no longer merged (
mergeable: false): its third hunk (dropping theserver->infisicaldepends_on) already landed separately onmainwhen Infisical moved behind theinfisicalcompose profile, and the branch was based on a long-supersededmain. #399 re-applies the two still-needed security hunks (hardcode Postgres host publish to127.0.0.1; RFC1918-only LAN-IP discovery with loopback fallback) cleanly onto currentmain. Closing in favor of #399.Pull request closed