Details
- Input validation
Reject commands containing shell operators:
|
&
;
$
`
- Sandboxed workspace execution
Workspace provisioning should run in a restricted environment (container / sandbox).
Minimal Patch Suggestion
One possible mitigation is to prevent agent principals from modifying execution-sensitive configuration fields such as workspaceStrategy.provisionCommand.
For example, during agent configuration updates, the server can explicitly reject this field when the request is authenticated using an Agent API key.
Example TypeScript guard:
// reject agent-controlled provisionCommand
if (
request.auth?.principal === "agent" &&
body?.adapterConfig?.workspaceStrategy?.provisionCommand
) {
throw new Error(
"Agents are not permitted to configure workspaceStrategy.provisionCommand"
);
}
Additionally, the server should avoid executing arbitrary shell commands derived from configuration values.
Instead of executing:
spawn("/bin/sh", ["-c", command])
prefer structured execution:
spawn(binary, args)
or restrict the command to a predefined allowlist.
Security Impact Statement
An authenticated attacker with an Agent API key can modify their agent configuration to inject arbitrary shell commands into workspaceStrategy.provisionCommand. These commands are executed by the Paperclip server during workspace provisioning via spawn("/bin/sh", ["-c", command]), resulting in arbitrary command execution on the host system.
Disclosure
This vulnerability was discovered during security research on the Paperclip orchestration runtime.
The issue is reported privately to allow maintainers to patch before public disclosure.