validator permission pin bypassable via an empty line inside the block #244
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/agent-foundry#244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Location
scripts/verify-agent-config.sh, the extraction awk insidecheck_permissions(n == 1 && inblock && /^ / { print; next }withthe fall-through
{ inblock = 0 }).Evidence
The extracted block ends at the first genuinely empty line, but a YAML
block sequence survives empty lines: rules indented after an empty
line are invisible to the exact-text comparison while OpenCode still
parses them as part of the same
permissions:list. So an adapterwhose pinned rules are followed by an empty line and a hidden
- action: "webfetch" / resource: "*" / effect: "allow"rule passesthe pin and the mixing rule unchanged, quietly widening a read-only
agent. Reproduced against the real program at
f491863; the samecraft passes main's pre-V2 extraction too, so the flaw predates the
V2 migration.
Scenario
Template content or a low-privilege downstream edit plants the hidden
grant in an adapter file. The validation suite — the mechanism that
exists to catch exactly that — reports the file as pinned, and the
role gains web access (or
edit).Smallest fix
One line in the extraction, so a block containing an empty line can
never equal the pin (fail-closed):
plus one tamper case beside the other OpenCode reviewer cases in
tests/agent-config/reviewer-adapters.sh.Seen at
f491863; reported bysecurity-reviewerin the review roundof pull request #242. A fix branch follows.