Erlang distribution listens on every interface with the cookie this repo publishes (mcl_mail on 0.0.0.0, cookie mcl_mail) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Purpose (defect): mcl-mail's Erlang distribution listens only on loopback, and no shipped file names a cookie, so a self-hoster who follows this repo's compose file does not expose a node that anyone holding a published cookie can drive.
What is wrong (measured 2026-11-23)
config/vm.args.src:2-3names the node${MCL_NODE_NAME}@${MCL_NODE_HOST}and sets-setcookie ${MCL_COOKIE}. It has no-kernel inet_dist_use_interface, and the image sets noERL_EPMD_ADDRESS.deploy/docker-compose.yml:35runsnetwork_mode: host, and:70hard-codesMCL_COOKIE=mcl_mail. README.md:213 gives the same default.epmd -namesinside the container readsname mcl_mail at port 36413, andss -ltnon the host shows0.0.0.0:36413and0.0.0.0:4369. mcl_chess on the same box is at127.0.0.1:46805.The fleet is less exposed: macula-fleet's
edge/scripts/docker-compose.mcl-mail.yml:33-34takes a random per-box cookie from the box's secrets. The listener on every interface is the same there.The fix already exists in the class
mcl-chess carries it (its
architecture/README.md, "Distribution stays, bound to loopback, with the cookie from the box, never the image", from mcl-om#24):ERL_EPMD_ADDRESS=127.0.0.1in the image,-kernel inet_dist_use_interface {127,0,0,1}invm.args.src, the compose file refusing to start without${MCL_COOKIE:?}, and a service test asserting all three.Done when
ss -ltnon a box running mcl-mail shows its dist port and epmd on 127.0.0.1 only.Found while measuring #16 (self-hosting). Every other mcl-* service on a host network may need the same check; that is not part of this issue.
Step 1, reachability probe (read-only), 2026-11-23, by Jupiter.
Result: reachable from the LAN, not from the internet. Dist 36413 (v4) and epmd 4369 (v4 and v6) answer from other LAN hosts. From two internet VPSes, both the router's public v4 and beam02's global v6 time out (filtered), and a positive control shows those VPSes do reach the internet on v4 and v6.
Listeners on beam02
pid 1734645 is
/app/bin/mcl_mail ... -boot /app/releases/0.6.1/startin container 25688a9d790b. The host's epmd (pid 1710) is what holds 4369 on v4 and v6.LAN (probe =
timeout 5 bash -c "</dev/tcp/$h/$p")Internet
The home's public v4 was read from the VPS side, as
ssh -4 nuremberg 'echo ${SSH_CLIENT%% *}', which gave109.133.95.139.Positive control from the same VPS:
rc=124 is a timeout, so the packets are dropped (filtered) at the router, not refused. Even beam02's v6 port 22 times out from outside (rc=124).
Cookie actually running
The live node does not run the published
mcl_mail. Its-setcookievalue is a 62-character string that comes from the container env (env | grep -ic cookie= 1), which matches the fleet compose's per-box secret. So the repo-published cookie does not open beam02. Anyone on the LAN who learns the real cookie does get in, because the listener is on every interface. The value is not reproduced here.What this means
ERL_EPMD_ADDRESS=127.0.0.1,${MCL_COOKIE:?}, a fresh cookie on beam02).Note: while I checked the cookie for step 1, part of the live cookie printed into my local session output (not posted anywhere). The rollout of this fix makes a fresh cookie on beam02, which retires it.