You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A code review of the repository surfaced several bugs and security
issues that this commit addresses together:
* content/store: resolveIdentifier and StoreArtifact now strictly
validate digests ("sha256:" + 64 hex chars) before using them as
filesystem path components. Without this, an identifier such as
"sha256:../../etc/passwd" flowed through filepath.Join and let
GetArtifact*/DeleteArtifact read or delete files outside the
store directory. A new ErrInvalidDigest sentinel is returned and
the refs-file path revalidates the digest on read.
* skills/remote: the remote-skills loader now rejects index entries
whose name is not a plain single path component (matched by a
conservative regex). Previously only entry.Files was validated,
so a hostile index could use a name like "../evil" to write
cache files outside the cache directory and later redirect
SKILL.md reads to attacker-chosen filesystem locations.
* hooks/executor: PreToolUse hooks that fail to run to completion
(timeout, parent-context cancellation, spawn error, missing
binary, ...) now deny the tool call instead of silently allowing
it. executeHook normalizes a fired context to a plain execution
error so aggregateResults can reliably fail closed on that event.
PostToolUse and other observational events keep their log-and-
continue behavior.
* agent: Agent.pendingWarnings is now guarded by a dedicated
sync.Mutex. addToolWarning and DrainWarnings are called from the
runtime loop, the MCP server, the TUI and the session manager in
parallel, and the concurrent append/read+clear was a data race.
* tools/builtin/shell: when cmd.Start() succeeds but the follow-up
createProcessGroup call fails, a new reapSpawnedChild helper
sends SIGTERM (with a SIGKILL escalation after a grace period)
and calls cmd.Wait() so the child is reaped and its stdout/
stderr pipes are closed. Both affected error paths now use it.
Each change ships with targeted tests (including -race where
relevant). mise lint is clean and the full test suite passes.
Assisted-By: docker-agent
0 commit comments