Skip to content

fix: make a command check give the same verdict in every process - #33418

Open
bolichen97 wants to merge 1 commit into
mainfrom
fix/25848-glob-verb-every-reading
Open

bolichen97 wants to merge 1 commit into
mainfrom
fix/25848-glob-verb-every-reading

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the same command gets the same security verdict in every Kiro Crew process, and that verdict is the cautious one.

A security check could refuse a command in one gateway process and allow the identical command in the next one. Reported in #25848.

Why it matters

A command this check exists to refuse could get through, depending only on which process happened to judge it. Every gateway start is a new roll.

Not a goal

  • Changing what the check refuses beyond giving one verdict in every process.
  • Telling a case pattern apart from a program name (see Backwards compatibility).
  • Making the check faster in general.

What changed (motivation → approach → change)

A command this check should refuse could pass in some processes, because the check picked one of the command's readings by chance. Now it judges them all, so every process refuses it.

Before After
Verdict for one command depended on the process the same in every process
A command with several readings one reading, picked by chance every reading is judged; refused if any reading would be refused

The change is in src/kiro_crew/security/, with a test in test/ that runs the same commands in fresh processes and a row in test/security_line_budget/ for the lines the package grows by. Judging every reading costs one pass per reading, and each nested part of a command is judged once per check through the check's existing per-check memo, so the readings do not multiply as commands nest. The security spec in docs/ lists that reader. It takes the core of #25993 and one of that PR's later additions, and leaves out the rest.

Builds on #25993 by @CrysisDeu.

Backwards compatibility

Breaking: a few command lines the check already refused in some processes are now refused in every process, for example case "$1" in s?? ) cp a localhost: ;; esac, or a line that quotes a cron schedule and later has a 0 or localhost word (30 4 * * * /opt/cleanup.sh --keep 0), or a line whose lone * word, read as ssh, reaches this machine (tar -czf certs.tgz * localhost.pem localhost-key.pem, find ~/.ssh -name '*' -type f -newer ~/.ssh/config). A glob program word that can name ssh gets ssh's answer: /usr/bin/s?? far.example.com id is refused, as ssh far.example.com id is, until the name's lookup finds it is not this machine. Writer sweep on origin/main @ 31b0c76: no shipped skill, doc or script line puts a glob program word or a lone * before a word that names this machine, so none sends such a line through the check.

Removes nothing: only private names change; no key, field, setting or public function is removed.

Tests

  • One test runs the same commands in fresh processes with different hash seeds and checks they all get the same, cautious verdict, and that a far host stays allowed.
  • One test checks that a command with many nested parts never judges the same part twice in one check.
  • One test checks that the same kind of command stays refused when another program launches it, however its program word is written.

Determinism: the changed test files pass under PYTHONHASHSEED 0, 1, 2 and 3, and in two shuffled orders (498 passed each).

Proof: PROVEN test/test_denied_commands_security_ssh_self.py::TestSandboxEscapeSshSelf::test_glob_naming_several_verbs_is_judged_as_each_in_every_process, test/test_denied_commands_security_ssh_self.py::TestSandboxEscapeSshSelf::test_nested_payloads_of_a_multi_verb_glob_are_judged_once (head 29695945d325)

Manual verification

On Linux (Ubuntu 24.04, Python 3.12), each command ran through the check in eight fresh processes (PYTHONHASHSEED 0 to 7). The tool gate a Bash call goes through refused /usr/bin/s?? x localhost under seeds 0, 2 and 5 on this branch, where main allowed it under seeds 2 and 5, and auto-approved ls -la on both.

Command main this branch
/usr/bin/s?? x localhost refused in 6 of 8 refused in 8 of 8
/usr/bin/s* x ::1 refused in 3 of 8 refused in 8 of 8
the issue's case line refused in 4 of 8 refused in 8 of 8
cp /usr/bin/s?? /tmp/q && /tmp/q x localhost refused in 6 of 8 refused in 8 of 8
ssh -V, ls -la, git status, tar -czf src.tgz src, find . -name '*.py' -type f allowed in 8 of 8 allowed in 8 of 8

Related Issues

Closes #25848

Sibling sweep

Swept: every loop over a set of program names in the same check
Siblings: none -- the other loops ask whether any name matches, which does not depend on order

Pattern harvest

Rule candidate: review-prompt
Pattern: a security decision that takes the first match from a set, so its answer follows the process's hash seed

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 8, 2026 21:10
@bolichen97
bolichen97 requested a review from Zedmor November 8, 2026 21:10
@bolichen97
bolichen97 enabled auto-merge (squash) November 8, 2026 21:14
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/__init__.py

  • src/kiro_crew/security/_exports.py

  • src/kiro_crew/security/argv_floor.py

  • src/kiro_crew/security/argv_floor_ssh.py

  • src/kiro_crew/security/call_views.py

  • No reasoning template for 1e896c2 yet.

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: 1e896c2c79d0c42e738275ce332def079aa698bf
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

@bolichen97
bolichen97 force-pushed the fix/25848-glob-verb-every-reading branch from 43b5496 to 907adca Compare November 9, 2026 22:31
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/security/argv_floor.py, src/kiro_crew/security/argv_floor_ssh.py, test/test_denied_commands_security_ssh_self.py, test/test_security_gate_liveness.py since this head went green (2caa69b -> 26e5535); CI re-running.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 1e896c2c79d0c42e738275ce332def079aa698bf touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 1e896c2c79d0c42e738275ce332def079aa698bf — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The fix goes at the root cause: the verdict depended on the order a frozenset was walked in, and now every verb the glob can name is judged, toward deny. The rename of _ssh_family_verb leaves no reader in the tree.

Notes

  • Marking _is_ssh_to_self once_per_call breaks the purity rule that call_views is built on, because it reads this host's names. The spec now records that exception. If a second host-reading function needs the same treatment later, give it its own per-call snapshot memo instead of adding more exceptions to the pure-reader memo.

[DESIGN-REVIEWED] 1e896c2

Description read

[DESCRIPTION-READ] d0bda4f18419b5a312ad0276408f72d2593e077724ba3c3a7f938345188b7c65

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 1e896c2c79d0c42e738275ce332def079aa698bf — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix removes the order-dependent verdict at its mechanism, the first-match loop over a frozenset, and the per-call memo is reused rather than duplicated.

What this change ships

Inventory (8 items) — 8 justified

Intent: a refused command stays refused no matter which gateway process judges it. FIX (#25848; the seed-0/3 subprocess test fails on base).

  1. A glob program word that can name several ssh-family programs (s?? as scp and ssh) is judged as each one, and refused if any reading reaches this host — justified
  2. The same command now gets the same verdict in every process, whatever its hash seed — justified
  3. A copied binary bound from such a glob carries every program it could be, not one chosen by chance — justified
  4. The ssh self-target check runs once per nested payload within one gate call, so cost no longer grows as 4^depth — justified
  5. The per-call memo's purity contract now names one exception: the host-name snapshot taken once per call — justified
  6. A private exported name is renamed (_ssh_family_verb → _ssh_family_verbs) — justified
  7. The package line budget rises by 29, with the measured reason — justified
  8. The security spec now lists the new memoized reader — justified

[FIRST-PRINCIPLES-REVIEWED] 1e896c2

Description read

[DESCRIPTION-READ] 6468aa07b26956d47bd4ef506030b8a1360d57a7e81d1cb3e9ad23c0e36bac18

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 1e896c2c79d0c42e738275ce332def079aa698bf — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1e896c2

Verdict parsed from the review's SHA-scoped output markers for commit 1e896c2c79d0c42e738275ce332def079aa698bf.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 1e896c2c79d0c42e738275ce332def079aa698bf false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 1e896c2c79d0c42e738275ce332def079aa698bf and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1e896c2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 1e896c2c79d0c42e738275ce332def079aa698bf false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🔴 BLOCK (blocking)

Which legitimate operations does 1e896c2c79d0c42e738275ce332def079aa698bf newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: a script-confirmed newly-refused operation.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 17 classified, 0 newly refused, 9 still allowed.
  • ubuntu-latest (platform posix): 17 classified, 2 newly refused, 9 still allowed.
  • windows-latest (platform windows): 5 classified, 0 newly refused, 3 still allowed.

Newly refused (confirmed by the real classifier at both refs)

  • find ~/.ssh -name '*' -type f -newer ~/.ssh/config (posix, leg ubuntu-latest)
    • Who loses it: an operator listing recently changed ssh files during a key rotation; a quoted lone * operand followed by more words
    • Refused by: deny-rules -- Blocked by security policy: (?:\A|[;&|\n]|\$\()[\s"'(]*(?:[\w.:/\\-]*[/\\])?(?:ssh|scp|sftp|rsync)(?:\.exe)?\s+(?:\S*@)?(?:localhost|127\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[?::1\]?|\$\(\s*hostname|\s*hostname|${?hostname}?)(?=[\s:'");&|#]|\Z)
      Matched structurally on the command's argv, not by the pat
  • tar -czf certs.tgz * localhost.pem localhost-key.pem (posix, leg ubuntu-latest)
    • Who loses it: a developer archiving mkcert-generated localhost dev certificates alongside a project; bare * followed by localhost-named files, not hosts
    • Refused by: deny-rules -- Blocked by security policy: (?:\A|[;&|\n]|\$\()[\s"'(]*(?:[\w.:/\\-]*[/\\])?(?:ssh|scp|sftp|rsync)(?:\.exe)?\s+(?:\S*@)?(?:localhost|127\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[?::1\]?|\$\(\s*hostname|\s*hostname|${?hostname}?)(?=[\s:'");&|#]|\Z)
      Matched structurally on the command's argv, not by the pat

Each row above is an operation that the base ref ALLOWS and this change REFUSES. Narrow the rule at the tier named. Withdrawing a row is not the way to green: that is its own pull request, on its own merits.

Scope-Verdict: PASS

Reason: The change closes an ordering bypass. A glob command word that can name several ssh-family verbs (s??, [rs]*, a lone *) was judged as only one of them, whichever came first in a hash-seed-dependent order. It is now judged as each verb, and refused if any reading reaches this host. None of the 22 candidates has a verdict yet. Two parts of the change can't be expressed as a candidate row and are named under UNADJUDICATED: the per-call snapshot of host names, and the remaining gap where a binary copied on an earlier command line can still carry a verb.

TIGHTENING: ssh self-target floor (argv_floor_ssh._is_ssh_to_self, which runs in the deny-rules tier) -- refuses a glob command word whose reading as ssh/scp/sftp/rsync reaches this host. Before, that word was judged as one arbitrary verb, so /usr/bin/s?? x localhost could be checked only as scp and get through. The hunk: - for verb in _SSH_FAMILY_VERBS: / - if fnmatch.fnmatchcase(verb, base) ...: return verb → + return tuple(verb for verb in sorted(_SSH_FAMILY_VERBS) if fnmatch.fnmatchcase(verb, base) ...) together with + for verb in verbs or (None,): yield i, token, verb.

ADJUDICATED: 22 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE:

  • posix (17 rows): The diff assumes the program word is a glob basename, read on every token and not only in command position. The rows cover:
    • path-qualified multi-verb globs (/usr/bin/s??, ~/.ssh/*);
    • bare * operands under programs that are not data consumers (tar, find, grep), including words after them that contain localhost but are not hosts (/var/www/localhost/htdocs/, localhost.pem);
    • quoted lone * as an rsync option value;
    • five-field cron schedules, where each * is now walked four times;
    • the xargs here-string rebuild;
    • the copy-binding path that now stores a tuple of verbs;
    • a [-bracket token ('[localhost]:2222').
  • windows (5 rows): These cover the .exe branch of the glob match (fnmatchcase(verb + ".exe", base)). That means s*.exe with \ separators, a %SystemRoot% path, and ssh.exe/scp.exe spellings, plus a bare * file spec followed by a switch with a UNC destination (robocopy).
  • any (0 rows): Every candidate names an executable or a path.

No platform assumption in the diff was left without a candidate.

UNADJUDICATED:

  • Per-call host-name snapshot. @once_per_call() is now applied to _is_ssh_to_self. That function reads this host's names (_OWN_HOST_NAMES_CACHE, resolver state), so the first answer for a given text is reused for the rest of one gate call. A shell-line classifier can't observe this. The path an input takes: gate call → deny-rules tier → _reaches_self_over_ssh → _is_ssh_to_self, then nested payloads through _xargs_here_string_rebuild and the rsync -e recursion. A legitimate input would be affected only if host names finished resolving partway through a single call and the cached answer differed from a fresh one. I can't build a shell row for that; it would need an in-process timing test.
  • Copies staged on an earlier command line. A copy of an ssh binary made on an earlier line (bound_program_verbs is per line) remains a documented residual. It is not something this change tightens.

[SCOPE-REVIEWED] 1e896c2

The confirmed rows, in the committed corpus's own shape
{
  "golden_paths": [
    {
      "kind": "shell",
      "command_or_flow": "find ~/.ssh -name '*' -type f -newer ~/.ssh/config",
      "platform": "posix",
      "reason": "an operator listing recently changed ssh files during a key rotation; a quoted lone * operand followed by more words"
    },
    {
      "kind": "shell",
      "command_or_flow": "tar -czf certs.tgz * localhost.pem localhost-key.pem",
      "platform": "posix",
      "reason": "a developer archiving mkcert-generated localhost dev certificates alongside a project; bare * followed by localhost-named files, not hosts"
    }
  ]
}

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 9, 2026
buluoray
buluoray previously approved these changes Nov 9, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on 907adca. A glob program word like s?? used to be judged as whichever ssh-family verb came first in a hash-seed-dependent frozenset walk; now every verb it can name is judged and any refusal refuses (security/argv_floor_ssh.py:587-622, :1137), with nested payloads memoised per outer call (:963-982). Verified deterministic and toward-deny across hash seeds. Still needs owner action: Security Scope red on the macOS /usr/bin/s?? remote.example.com id row (uncached host, fail-closed, same as plain ssh; declared Breaking, owner override) and Sensitive Change Review for src/kiro_crew/security/.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@bolichen97
bolichen97 force-pushed the fix/25848-glob-verb-every-reading branch from 907adca to 1f3a918 Compare November 10, 2026 15:33
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_security_gate_liveness.py since this head went green (26e5535 -> b58eef1); CI re-running. That file conflicted on the package line budget; the budget is re-measured on the new base. The change itself is the same patch.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 10, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_security_gate_liveness.py and docs/system-specs/modules/security.md since this head went green (8d04c52 -> 4de745e); CI re-running. The package line budget conflicted with main's raise for paths_resolver (#29368): both raises are kept and the total is re-measured (35,833).
[operator: bolichen97]

@bolichen97

bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: a private per-call memo for the ssh self-target walk
resolution: removed -- the private memo is deleted and the walk is marked call_views.once_per_call, so one gate call keeps one memo

  • span=4802a4d7b668 A second per-call memo beside once_per_call

fixed in 676bbb3: _SSH_SELF_VERDICTS and _shares_nested_verdicts are deleted; _is_ssh_to_self carries @once_per_call(), so its nested payloads share the memo is_denied opens with @sharing_views, and argv_floor_ssh.py defines no ContextVar of its own.
The cost test runs the walk inside sharing_views and fails without the mark (15,625 frame reads instead of one per text); the with-memo/without-memo corpus check in test_deny_gate_call_sharing.py covers the walk.
call_views.py and the security spec name its one non-pure input: its host reads are that call's snapshot, the assumption the private memo already made. This change adds 29 lines to the package budget.
[operator: bolichen97]

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 12, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • /usr/bin/s?? remote.example.com uptime (posix, macos-latest leg)

Rebutted: not a new refusal. s?? names both scp and ssh. In the same deny_diff harness, base 0feaa8b against this head under PYTHONHASHSEED 0..7, the literal /usr/bin/ssh remote.example.com uptime and ssh remote.example.com uptime are refused at both refs under every seed, and /usr/bin/scp remote.example.com uptime is allowed at both.
Base judged the glob as whichever verb its hash-ordered set walk met first: it refused this row under seeds 1, 2, 4, 5 and 7 and allowed it under 0, 3 and 6. The macOS leg drew an allowing seed at base and the ubuntu leg a refusing one, which is why only one leg lists the row. This head refuses it under every seed.
The literal ssh line is refused there because the harness has not resolved remote.example.com yet and main's host check answers an unresolved dotted name fail-closed; this PR does not change that check. With the host known to be remote, the glob and the literal ssh line are both allowed, which the PR's multi-seed test pins.
That seed-dependent verdict is #25848; giving the glob the cautious verdict of every verb it can name is the fix. Same row and ruling as the disposition at 1f3a918.
[operator: bolichen97]

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 13, 2026
@bolichen97
bolichen97 force-pushed the fix/25848-glob-verb-every-reading branch from 676bbb3 to d273370 Compare November 13, 2026 06:38
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_security_gate_liveness.py and docs/system-specs/modules/security.md since this head went green (4de745e -> 510ba1b); CI re-running. The package line budget conflicted with main's raise for text_redaction (#36196): both raises are kept and the total is re-measured (35,853). No production hunk changed.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • */5 * * * * curl -fsS localhost:8080/health (posix, macos-latest and ubuntu-latest legs)

Rebutted: not a new refusal. The lone * names every ssh-family verb. Base judged it as whichever verb its hash-ordered set walk met first: in the same deny_diff harness, base 510ba1b against this head under PYTHONHASHSEED 0..7, base refuses this row under seeds 3, 4, 6 and 7 and allows it under 0, 1, 2 and 5. Both CI legs drew an allowing seed at base. This head refuses it under every seed.
The row is a crontab line typed as a shell command: bash would run the glob-expanded */5 as the program, so it installs nothing. The ways an operator installs that line, echo '*/5 * * * * curl -fsS localhost:8080/health' | crontab - and (crontab -l; echo "...") | crontab -, are allowed at both refs under every seed, and so is the bare curl -fsS localhost:8080/health.
That seed-dependent verdict is #25848; giving the glob the cautious verdict of every verb it can name is the fix. Same ruling as the dispositions at 1f3a918 and 676bbb3.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • 0 * * * * curl -s 127.0.0.1:9090/metrics -o /tmp/metrics.txt (posix, macos-latest and ubuntu-latest legs)

Rebutted: not a new refusal. Each lone * names every ssh-family verb. Base judged it as whichever verb its hash-ordered set walk met first: in the same deny_diff harness, base 510ba1b against this head under PYTHONHASHSEED 0..7, base refuses this row under seeds 3, 4, 6 and 7 and allows it under 0, 1, 2 and 5. Both CI legs drew an allowing seed at base. This head refuses it under every seed.
The row is a crontab line typed as a shell command: bash would run 0 as the program, so it schedules nothing. The way an operator appends that line, (crontab -l; echo "0 * * * * curl -s 127.0.0.1:9090/metrics -o /tmp/metrics.txt") | crontab -, is allowed at both refs under every seed.
That seed-dependent verdict is #25848; giving the glob the cautious verdict of every verb it can name is the fix. Same ruling as the dispositions at 1f3a918 and 676bbb3.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The red Backend Lint & Type Check (3.12) on this head, and the Coverage Gate that fails after it, are main's: mypy reports src/kiro_crew/cli_commands_memory.py:335: error: Incompatible types in assignment on main too (push run 43380448651 at 9c31bcd), and this PR does not touch that file. It is tracked in #36458 and fixed by #36457. This PR waits for that fix to merge, then re-syncs onto it.

Opus 5.5 Review and Analyze (python) failed on a GitHub API rate limit for the installation, not on a finding; each gets one rerun.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Re-sync budget reset: this PR is inside its 48-hour watch window, conflicts with main again (test/test_security_gate_liveness.py), and needs main's mypy fix (#36457) to clear its red lint check, so it gets another three re-syncs to stay green.

[operator: bolichen97]

A security check could refuse a command in one process and allow the
same command in another. It now gives one verdict everywhere, and that
verdict is the cautious one.

Builds on #25993 by CrysisDeu.

Closes #25848
@bolichen97
bolichen97 force-pushed the fix/25848-glob-verb-every-reading branch from d273370 to 1e896c2 Compare November 13, 2026 08:45
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_security_gate_liveness.py and src/kiro_crew/security/ since this head went green (510ba1b -> 187b4da); CI re-running. The package line budget conflicted with main's raise for paths_targets (#33589): both raises are kept and the total is re-measured (35,930). The new base also carries main's mypy fix (#36457) that the red lint check needed. No production hunk changed.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • find ~/.ssh -name '*' -type f -newer ~/.ssh/config (posix, ubuntu-latest leg)

Rebutted: not a new refusal. The quoted lone * names every ssh-family verb, and base already reads it as a program word. Base judged it as whichever verb its hash-ordered set walk met first: in the same deny_diff harness, base 187b4da against this head under PYTHONHASHSEED 0..7, base refuses this row under seed 2 and allows it under the other seven. This head refuses it under every seed.
The refusing reading is ssh: ssh -type f -newer ~/.ssh/config is refused at base and at this head alike, and the sftp, scp and rsync readings are allowed at both.
The same search without the lone glob, find ~/.ssh -type f -newer ~/.ssh/config, and with a pattern that names no verb, find ~/.ssh -name '*.pub' -type f -newer ~/.ssh/config, are allowed at both refs under every seed.
That seed-dependent verdict is #25848; giving the glob the cautious verdict of every verb it can name is the fix, and telling a pattern apart from a program name is outside this PR's goal. Same ruling as the dispositions at 1f3a918, 676bbb3 and d273370.
[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • tar -czf certs.tgz * localhost.pem localhost-key.pem (posix, ubuntu-latest leg)

Rebutted: not a new refusal. The lone * names every ssh-family verb, and base already reads it as a program word. Base judged it as whichever verb its hash-ordered set walk met first: in the same deny_diff harness, base 187b4da against this head under PYTHONHASHSEED 0..7, base refuses this row under seeds 0, 1, 2 and 5 and allows it under 3, 4, 6 and 7. This head refuses it under every seed.
The refusing readings are ssh and sftp, where localhost.pem sits in the host slot: ssh localhost.pem localhost-key.pem and sftp localhost.pem localhost-key.pem are refused at base and at this head alike, and the scp and rsync readings are allowed at both.
The same archive without the lone glob, tar -czf certs.tgz src localhost.pem localhost-key.pem, is allowed at both refs under every seed.
That seed-dependent verdict is #25848; giving the glob the cautious verdict of every verb it can name is the fix, and telling a file glob apart from a program name is outside this PR's goal. Same ruling as the dispositions at 1f3a918, 676bbb3 and d273370.
[operator: bolichen97]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: ssh-self floor verdict depends on hash seed when a glob names several ssh verbs

3 participants