Repository navigation
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The DNS wait works at the mechanism level and reuses the existing condition, memo and event-loop check. The Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let an agent's first ssh to a remote host succeed instead of hitting a false self-target refusal. FIX.
[FIRST-PRINCIPLES-REVIEWED] cde99a9 Description read[DESCRIPTION-READ] 495df514d61ea734d884efa9981090d5c4b74bc7cce4b0eb801207ac5363cf91 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the wait is capped at 0.5 s for each check and never runs on the event loop. Every refusal that matters is unchanged: a loopback answer, a failed lookup and a lookup still running when the wait ends. Notes
[DESIGN-REVIEWED] cde99a9 Description read[DESCRIPTION-READ] d4ae111534288f051c80ecaaef4a642465ee6d9297920533c6803e66dfd6e848 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
20adef9 to
f1b9013
Compare
|
span=003081c85db9
|
The ssh-to-self floor refused the first ssh to a new dotted name while the DNS lookup it had just started was still running, and allowed the same command a moment later. `ssh -T git@github.com` failed on the first try in a fresh process, and so did `git add s* README.md`, where the glob can name an ssh program and the floor checks README.md as a host. Off the event loop, the first check of a new dotted name now waits for that lookup, at most half a second per check, and answers from it. A loopback answer, a failed lookup, or a lookup still running when the wait ends stays refused. The event loop itself never waits. Closes #37311
f1b9013 to
cde99a9
Compare
|
Security Scope Review on
The lane's own reasoning reaches the same place: "ADJUDICATED: 15 candidates, 0 confirmed newly-refused", and every new exit path still returns |
|
/ai-review override scope cde99a9 pre-existing #25848: agent: both newly-refused rows (git add s* README.md, tar s* notes.txt) flip with PYTHONHASHSEED on main too, because s* reads as ssh or scp by set order. Pinned to one seed, base and head give the same verdict: #38656 (comment) |
Human judgment recorded@buluoray recorded a pre-existing release (class
This decision applies only to this commit. A new push requires a new judgment. |
Sensitive change review
|
Problem / Motivation
Goal: The ssh-to-self floor allows a remote host, and an ordinary file name after a glob, on the first try instead of refusing it while a DNS lookup is still running.
In a fresh process the floor refused
ssh -T git@github.comon the first call and allowed it a few seconds later.git add s* README.mdfailed the same way: refused once, then allowed. Both came from the same place. The first check of a new dotted name started a DNS lookup and refused at once, before the answer came back.Why it matters
An agent doing git over ssh (an auth check before a push, a fetch) gets a refusal on its first try for a host that is not this machine. An agent staging files with a glob gets a security refusal for a plain
git add. Both look like random failures, and the refusal text quotes the loopback rule, which is misleading.Not a goal
What changed (motivation → approach → change)
git add s* README.md, first call, off the event loop, when the lookup answers remote_resolved_host_verdictinargv_floor_hosts.pywaits for the resolver worker it started, off the event loop only, at most_HOST_VERDICT_WAIT_SECS(0.5 s) in total per check. The worker signals a condition when it finishes. One check shares one deadline through its_CALL_VIEWSmemo, so a line naming several new hosts still waits half a second at most. This follows the maintainer decision on #37311.git add s* README.mdis covered by the same wait. The globs*can namessh, so the floor checksREADME.mdas a host and looks it up; the remote answer now lands before the verdict. The floor still reads that word as a possible host, because it cannot always tell whether bash runs the glob. When the name has no DNS record, the resolver worker runs the ssh config route check before it publishes, so the same wait covers it: if both finish inside the budget, the first call gets the answer later calls get (a clean ssh config proves nothing, so such a name stays refused on every call, as on main).The security spec sentence on pending dotted names (
docs/system-specs/modules/security.md) is updated, andtest/security_line_budget/ssh-self-dns-wait.txtrecords the +56 lines.Backwards compatibility
Compatible: commands that were allowed stay allowed; the only change is that some first-call refusals become allows after a successful remote lookup.
Removes nothing: no rule, key, or function is removed; every refusal for a loopback answer, a failed lookup, or this host's own names stays.
Tests
test/test_denied_commands_security_dns_wait.py, all with a stub resolver (no network):git add s* README.md,git add ss* README.mdand a glued redirect are allowed on the first check;git add ss* localhost,ss* self.alias.example id, afind -exec s?hrow, ands?h self.alias.example id.Proof: PROVEN test/test_denied_commands_security_dns_wait.py::test_a_remote_name_is_allowed_on_the_first_check, test/test_denied_commands_security_dns_wait.py::test_a_file_name_after_a_glob_is_allowed_on_the_first_check[git add s* README.md], test/test_denied_commands_security_dns_wait.py::test_a_file_name_after_a_glob_is_allowed_on_the_first_check[git add ss* README.md], test/test_denied_commands_security_dns_wait.py::test_a_file_name_after_a_glob_is_allowed_on_the_first_check[git add ss* README.md>out.log], test/test_denied_commands_security_dns_wait.py::test_a_name_with_no_dns_record_gets_its_later_answer_on_the_first_check[True-None] (head cde99a9)
Determinism: the new file passed 20 of 20 runs at
-n0, 10 of 10 at-n 4besidetest_denied_commands_security_own_host.py, 3 shuffled orders, and 6PYTHONHASHSEEDvalues. The related security files (ssh-self, own-host, hosts-file, facade, call sharing, ssh config route, gate liveness, rows, guidance, argv rules, and the other deny-gate files) pass. The flake-pattern ratchet and the repo semgrep rules pass on the diff.Manual verification
Three calls of
deny_gate.is_deniedin one fresh process, with a stub resolver that answers after 0.1 s:git add s* README.mdandssh -T git@github.comare allowed on all three calls (main: refused on the first), and a loopback alias, a failed lookup andssh localhostare refused on all three. With a 1 s stub answer, the firstssh -T git@github.comis refused (the wait ended) and the next is allowed.Related Issues
Closes #37311
Sibling sweep
Swept: git grep -n "_resolved_host_verdict(" -- src/
Siblings: none -- _host_is_self is the only caller that answers a miss fail-closed, and it is the path changed here
Pattern harvest
Not generalizable: the fail-closed answer for a lookup that has not finished yet belongs to this one verdict cache.
Checklist