Repository navigation
test: check the ssh floor's nesting bound below the gate's depth cap - #37964
Conversation
#37875 made the gate refuse any command nested past 32 substitutions before a floor reads it, so the 128-level nest in #37820's test is now refused by that cap and the test, which expected the ssh floor's rule, is red on main. The test now checks the floor's bound at exactly 32 levels, which the cap lets through, and that 128 levels get the cap's own refusal. Closes #37963
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this only updates one stale test, and the two refusal paths it checks are unchanged. Notes
[DESIGN-REVIEWED] 5780a43 Description read[DESCRIPTION-READ] f017e76bd0363e7c8583c1e2f1a5fb0afbd183bfe8f5141af74f4c2f8ddc3a0f 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: |
…37964) #37875 made the gate refuse any command nested past 32 substitutions before a floor reads it, so the 128-level nest in #37820's test is now refused by that cap and the test, which expected the ssh floor's rule, is red on main. The test now checks the floor's bound at exactly 32 levels, which the cap lets through, and that 128 levels get the cap's own refusal. Closes #37963 (cherry picked from commit 529da1e)
…37964) #37875 made the gate refuse any command nested past 32 substitutions before a floor reads it, so the 128-level nest in #37820's test is now refused by that cap and the test, which expected the ssh floor's rule, is red on main. The test now checks the floor's bound at exactly 32 levels, which the cap lets through, and that 128 levels get the cap's own refusal. Closes #37963 (cherry picked from commit 529da1e)
…37964) #37875 made the gate refuse any command nested past 32 substitutions before a floor reads it, so the 128-level nest in #37820's test is now refused by that cap and the test, which expected the ssh floor's rule, is red on main. The test now checks the floor's bound at exactly 32 levels, which the cap lets through, and that 128 levels get the cap's own refusal. Closes #37963 (cherry picked from commit 529da1e)
…37964) #37875 made the gate refuse any command nested past 32 substitutions before a floor reads it, so the 128-level nest in #37820's test is now refused by that cap and the test, which expected the ssh floor's rule, is red on main. The test now checks the floor's bound at exactly 32 levels, which the cap lets through, and that 128 levels get the cap's own refusal. Closes #37963 (cherry picked from commit 529da1e)
… main (#39387) Backports to release/0.13.0 the fixes from #39342, squashed into one commit and brought up to date with release/0.13.0 after the Kiro Memory preview backport (#39360). Picks, in order; each [pick sha] is the commit on the #39342 branch, whose body has main's cherry-picked-from line: - fix(monitor): wake the session once when its watched PR merges or closes (#37776) [pick 84da419] - fix(security): match deny rules against Windows program suffixes and cmd/PowerShell in-word escapes (#33569) [pick e4941b7] - fix(mimocode): refuse a chat that would answer from Xiaomi's hosted model unsigned (#37629) [pick 1bfdce3] - fix(acp): end a quiet agent-started cycle on the shared runtime's stale gate (#37932) [pick fa870a2] - fix(conductor): re-read goal-conductor after a compaction (#37917) [pick ccdd67c] - fix(security): refuse a command nested past 32 substitutions before the floors walk it (#37875) [pick 2f9bd67] - fix(mates): carry a moved Bot's shell toolsSettings entry as execute_bash instead of holding it (#37973) [pick 16022f4] - fix: hold an app to its own sessions, jobs and runs (#37804) [pick 3dff0c0] - fix(acp): keep a KAS chat's stored record when its resume fails after the load (#37955) [pick 6ceb7b5] - fix(gateway): ignore a repeat SIGTERM during graceful shutdown (#38031) [pick b48287d] - fix(security): keep a quote in a $( ) from hiding a later ssh (#37558) [pick b9fed61] - fix(agent): rebuild takes a server's disabledTools from the kiro global (#38147) [pick c50bbcc] - fix(mcp_gateway): keep the backend when a stub leaves an open listen (#38121) [pick 3e9c7f9] - fix: refresh plan and model list after a kiro-cli sign-in to another account (#38053) [pick 5ad3d36] - fix(slack): keep a picture sent in a linked thread for the dashboard turn (#38076) [pick 7f8903e] - fix: keep a resolved tool policy when the gateway is too slow to answer (#36669) [pick 9be5691] - fix: open owner-only files and prune overlay folders without following links (#36994) [pick 6a1acc9] - fix: refuse the local token mint to app backends (#38113) [pick d166dab] - fix(subagent): hold a spawn's first prompt for its MCP servers (#38127) [pick e3e0298] - fix(security): refuse a headless git --output write with no approver (#36326) [pick 1abee40] - fix(restore): require an explicit mode, never default to replace (#38094) [pick ca86c06] - fix: make the deny gate's shell walk linear in command length (#36437) [pick 22c100b] - fix(chat): let a cancelled background start finish its session teardown (#36664) [pick b1dd34f] - fix(acp): refuse a start when two differing specs declare the agent's name (#38411) [pick 80ccfff] - fix: probe a silent turn while its co-tenant keeps the process busy (#38662) [pick 6354490] - fix(kas): let a reopened chat switch to models its load select omits (#38376) [pick 1640822] - fix(cloud): install a patched node 22 on run on aws instances (#38732) [pick 059cb90] - fix: write member record files without following links (#37303) [pick aac9642] - fix: fail a kas start fast once the host has turned its mcp off (#38677) [pick e147238] - fix(decisions): fall back to HTTP/1.1 when h2 is missing (#38759) [pick fc16482] - fix(mcp_gateway): free a spawn permit when its backend exits before initialize (#38793) [pick a084ba2] - fix(kas): start an app chat whose tool policy hides every kirocrew-cron tool (#38761) [pick ccea5a9] - fix(acp): give the tool-stall watchdog a margin over native waits (#34117) [pick b5d9e89] - fix(mcp): bind the working-folder answer to its launch; observe launch changes behind name grants (#38983) [pick a1069be] - fix(mcp): hide the gateway secret files from the npm install and third-party probe spawns (#39000) [pick 14d8571] - fix(sandbox): fold env name case on Windows in the agent env scrub (#33997) [pick 9bdce76] - fix(apps): let app turns follow the Auto approval mode (#38830) [pick e8336df] - fix: end a dashboard turn stopped while it is still being prepared (#36478) [pick 37fff93] - fix(acp): cleanup_session deletes the record on the session's own host (#39046) [pick 31b5ec4] - fix(acp): scan only the new part of a streamed tool result (#38852) [pick e2870db] - fix(sandbox): make an unscoped session host the OOM victim, not the gateway (#39189) [pick 2be6dde] - fix(security): read aws s3 downloads piped into tail, with 2>&1, or with an AWS_PROFILE prefix (#38271) [pick bf65d97] - fix: redact four display and log paths and use a fixed 502 message for session switch refusals (#38982) [pick 55d9ec7] - fix(sandbox): pin a credential-masking app's folder after the masks on the namespace backend (#34339) [pick afd2b14] - fix(acp): wait for systemd scope admission as its own startup stage (#37008) [pick 3e29c86] - fix(acp): wait for systemd scope admission on the AcpClient spawn path (#38303) [pick 85f0a25] - fix(acp): stamp the spawn instance on the AcpClient child (#38810) [pick f36eb5a] - fix: end the turn when the agent never confirms a stop (#38512) [pick 2665c9d] - fix(kas): renew a refused crew sign-in instead of failing every start (#38978) [pick 2f48cac] - fix(security): keep self-host detection when the ssh verb is a glob (#34056) [pick ab53f10] - fix(security): judge each substitution body for ssh-to-self (#37616) [pick d5b7ac3] - test: check the ssh floor's nesting bound below the gate's depth cap (#37964) [pick 6c9ae1d] - fix(mate): apply held Bot limits on shared claude sessions and refuse unnarrowed KAS children (#39212) [pick 721bbbe] - test(integration): wait out and reset the hidden-chat refresh between boots (#37933) [pick e77586d] - fix(browser): fall back to Kiro's Chromium under Automatic when Chrome's remote debugging is off (#39265) [pick 31912eb] Left out of #39342's set (not needed for 0.13.0): the provider_labels refactor, #34045, #36668, #39120 and #37627. Merge with release/0.13.0: kept both imports in runtime_session_load, runtime_spawn_launch and session_provider; session_allocation lists the memory_policy owner; the keep-record resume path passes kas_memory_mode as main does; dropped the ACP_BACKENDS_SESSION_EVICTION import that moved to session_provider_new_conversation.
Problem / Motivation
Goal: Make main's backend tests green again by updating one ssh-floor nesting test that the new substitution-depth cap made stale.
test/test_denied_commands_security_ssh_self.py::TestSshFloorNestingDepth::test_the_gate_refuses_a_nest_past_the_bound_without_an_exceptionfails on maind2f22f259eb0(Backend Tests (3.12, 6) and (Windows) (6) on every PR):Why it matters
Every open PR's backend shard 6 is red until this lands, so nothing that needs a green backend run can merge.
Not a goal
What changed (motivation → approach → change)
$( )nest through the gate and expects the ssh floor's rule,sandbox-escape-ssh-self._MAX_SSH_READING_DEPTH(32) levels. The gate cap lets that depth through, and the floor's reading bound refuses it withsandbox-escape-ssh-self. It also checks that 128 levels get the cap's refusal (substitution nesting deeper than 32). Measured on main: 31 levels are allowed, 32 are refused by the floor, 33 and up by the gate cap.Backwards compatibility
Compatible: test-only change; no product code moves.
Removes nothing: the test keeps checking the floor's bound through the gate and adds a check on the cap; no product behavior changes.
Tests
test_the_gate_refuses_a_nest_past_the_bound_without_an_exception: failed on main before the change, passes after. With_MAX_SSH_READING_DEPTHraised to 64, it fails again, so it still pins the floor's bound.test_denied_commands_security_ssh_self.pyandtest_denied_commands_security_nesting.py: 415 passed.test_flake_pattern_ratchet.py: 71 passed.Proof: not provable -- test-only change
Manual verification
N/A — unit coverage sufficient; the change is one test.
Related Issues
Closes #37963
Sibling sweep
Swept:
git grep -n "_nested_double_quoted(128\|_nested_double_quoted(1000" -- test/Siblings: none -- the other deep-nest tests call
_reaches_self_over_sshdirectly, below the gate cap, and still passPattern harvest
Not generalizable: two correct refusals landed in either order; the stale expectation is a one-off merge race, not a code pattern.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.