fix(kanban): confine completion artifacts to task workspace - #86610
Open
enzo-adami wants to merge 3 commits into
Open
fix(kanban): confine completion artifacts to task workspace#86610enzo-adami wants to merge 3 commits into
enzo-adami wants to merge 3 commits into
Conversation
enzo-adami
marked this pull request as ready for review
August 15, 2026 03:35
enzo-adami
force-pushed
the
agent/confine-kanban-completion-artifacts
branch
from
August 15, 2026 18:44
95a2f8b to
ab93d6b
Compare
Contributor
fix(kanban): confine completion artifacts to task workspace
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
O_NOFOLLOWwhere the platform provides it, then compare the opened descriptor's device/inode and validate its type and size before copying.O_DIRECTORY | O_NOFOLLOWtraversal, create files withO_EXCL, and perform rollback cleanup relative to the pinned task-directory descriptor.dir_fdfallback also rejects symlinked components withlstat.kanban_completeschema text to state the workspace and staging contract.Why
The completion path previously accepted host paths outside the task workspace. A first confinement pass still left two check/use boundaries:
attachment_dir.mkdir(parents=True, exist_ok=True)accepted a pre-planted directory symlink and redirected the durable copy outside Hermes storage.The second issue was reproduced deterministically on both the default and a named board: completion succeeded and wrote
report.pdfthrough a symlink into an external directory. Destination traversal and file creation are now relative to pinned directory descriptors, so replacing the visible pathname cannot redirect the open. The notifier independently refuses a symlinked durable root.Rejected declarations or unsafe destinations roll back task completion so the worker can correct the path and retry. If a staged attachment disappears after completion, the notifier skips it without stopping delivery of the remaining artifacts.
Validation
Reproduced before the fixes:
b"host secret";After the fixes:
The test set covers Kanban completion and boards, gateway watcher delivery, tool handling, notifier behavior, attachment persistence, worker image extraction, delegated-child isolation, collision-safe durable names, and native/fallback destination traversal.
Follow-up
#82908 returns the newly durable artifact paths directly from
kanban_complete, which is useful for Desktop artifact indexing but is not required for confinement correctness. It is intentionally not absorbed here so this security fix stays focused; it should be rebased on this PR (or implemented separately after merge).