Enforce the epoch admin lever's loopback binding and settle its authentication #34
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
vnprc/hashpool#34
Loading…
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?
Make the epoch admin listener's loopback-only binding and its lack of authentication explicit and enforced, rather than conventions that a config typo can silently undo.
Primary goals:
admin_addris refused at startup instead of quietly exposing epoch rotation to the network.just rotate-epochreads the configured address rather than carrying its own copy.Current state and specifics
The mint binds the epoch admin listener to
127.0.0.1:3339by default andjust rotate-epochposts to that address. Two problems follow from this being convention rather than a rule.Nothing validates the configured address. Setting it to
0.0.0.0inconfig/mint.config.tomlmakes the rotation lever reachable from the network, and the lever is unauthenticated, so anyone who can reach it can close the current epoch and open the next. Rotation is not destructive in itself, but it decides which currency unit new mining rewards are denominated in, so an attacker who can rotate at will can fragment every miner's rewards across units at no cost.just rotate-epochalso hardcodes the port and ignores the configured value, so the two can disagree without anything reporting it. An operator who moves the port gets a recipe that silently targets the wrong place.Scope
In scope: validate the configured admin address at startup and refuse a non-loopback bind unless something explicit opts in; make the justfile recipe read the configured address; and decide the authentication question one way or the other, recording the decision where the listener is set up.
Out of scope: any change to what the lever does, and the automatic reward trigger of vnprc/hashpool#18, which will drive rotation without the lever.
Validation
Start the mint with a non-loopback
admin_addrand confirm it refuses to start, with a message naming the setting. Change the configured port and confirmjust rotate-epochstill reaches the lever without being edited. If authentication is added, confirm an unauthenticated request is refused and thatjust rotate-epochstill works.