You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pin the GitHub Host in the Hub Scripts So GH_HOST Cannot Move Their Reads and Writes #4489
Most of the hub's gh calls name no host, so they follow GH_HOST when it is set. The registry names every repository on github.com, so an audit, a review-loop read, or a merge run with GH_HOST pointing at another host reads or writes that other host instead. spec/audit_environments.py (from #4480) is the one site that pins --hostname github.com, with the reason written beside it.
Failure
With GH_HOST=other.example exported, spec/audit.py's gh() sends gh api repos/ptr727/<repo> to other.example. The audit then reports drift, or a 404, from a host the registry never named, while its environment checks in the same run stay on github.com.
Sites
Each counts list-form "gh", ... calls that carry no --hostname:
spec/audit.pygh() (1)
spec/resolve_secrets.py (4), read_live_names among them
The shell and PowerShell scripts have not been swept.
Fix
Pin the host once per entry point rather than per call, for example a shared helper that sets --hostname github.com for gh api and GH_HOST=github.com in the child environment for the other subcommands. Add a test that runs a site with GH_HOST set to a constructed host and asserts the call still targets github.com. Whether every site warrants it is a Trust Boundaries and Hardening Effort judgment. The audit and the review-loop writes are the ones that act on what they read.
Origin
Raised by the local strict review on #4480 against unchanged code, and listed there under Pre-existing findings, not filed. Filed under pr-review-conduct outcome 4, since it is a correctness defect with a stated failure.
Another site of this class, raised by the frontier local strict review over promotion #4485, where it holds the merge gate: spec/audit_environments.pynames() (line 27, from #4480) duplicates read_live_names at spec/resolve_secrets.py:207, and only the first one pins the host. A fix here should give both callers one host-pinned reader, rather than pinning the second copy.
Activity
ptr727 commentedon Nov 26, 2026
Another site of this class, raised by the frontier local strict review over promotion #4485, where it holds the merge gate:
spec/audit_environments.pynames()(line 27, from #4480) duplicatesread_live_namesatspec/resolve_secrets.py:207, and only the first one pins the host. A fix here should give both callers one host-pinned reader, rather than pinning the second copy.Pin the GitHub Host for Every gh Child the Hub Scripts Start (#4502)