Remote project and task metadata is injected into the coding agent's prompt
Description
Affects all veans versions (veans has no tagged release yet).
Summary
A project member with write access sets a project title, or task titles and descriptions, that veans feeds verbatim into a coding agent's instructions on every session start. The text is rendered inside the authoritative instruction block, so the agent may follow it.
Details
veans/internal/commands/prompt.tmpl:1-8andveans/internal/commands/prime.go:87-97render the fields inside the authority block.- The hook runs
primeon SessionStart and PreCompact (veans/internal/bootstrap/hooks.go:35,41). - Three of the four rendered fields come from
.veans.yml, which adds nothing because the repo already controls CLAUDE.md.ProjectTitle(from the server) and task content fromlist/showare the real boundary. - On an untrusted server (see the
VEANS_TOKENredirect advisory), the server itself controls all of this content.
Impact
Prompt injection into an agent that can read and change the developer's checkout and run commands. Requires write access to the project (or a hostile server), and depends on the agent acting on the injected text.
Fix
Two parts.
- Trust gate: an untrusted server's metadata never reaches the prompt, because
primefails closed when it isn't interactive. It renders without remote metadata, plus a hint to run any veans command interactively to trust the server. - Fencing, which is still required: a writer on a trusted server can set
ProjectTitleand task content. Render remote metadata and task content as a fenced, labeled untrusted-data block, outside the authority section.
The trust gate is a single origin check in the client/runtime setup (veans/internal/commands/runtime.go:57-63), with trust records in global XDG state keyed by normalized origin plus repo identity, an interactive confirmation, and fail-closed behavior when non-interactive.
Found via internal security review (csf #3, 03 #13, deep #9).