CVE-2026-41208: Paperclip Privilege Escalation Vulnerability
HIGHCVE-2026-41208 is a HIGH (CVSS 8.8) privilege escalation vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Paperclip libraries in the npm ecosystem. The issue involves privilege escalation via agent-controlled workspacestrategy.provisioncommand leading to os command execution. Remediation is available by upgrading affected packages to version 2026.416.0.
CVE-2026-41208 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-41208
To remediate this vulnerability, upgrade all affected Paperclip dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @paperclipai/server@2026.416.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @paperclipai/server
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-41208, inspect your project dependencies using npm:
npm ls @paperclipai/server
Analyze the terminal output to locate any version of Paperclip in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.416.0), your application is affected.
Note: The npm ls @paperclipai/server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Paperclip, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-41208 Affected Paperclip Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@paperclipai/server
|
npm |
< 2026.416.0
|
2026.416.0
|
References
Frequently Asked Questions
What is CVE-2026-41208?
Which Paperclip versions are affected?
What version fixes CVE-2026-41208?
Is @paperclipai/server affected?
What is the CVSS score of CVE-2026-41208?
What CWE is associated with CVE-2026-41208?
How can I check npm dependencies for CVE-2026-41208?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-265w-rf2w-cjh4",
"modified" : "2026-04-24T20:53:40Z",
"published" : "2026-04-16T22:45:26Z",
"aliases" : [ "CVE-2026-41208" ],
"summary" : "Paperclip: Privilege Escalation via Agent-Controlled workspaceStrategy.provisionCommand Leading to OS Command Execution",
"details" : "### Summary\nPaperclip contains a privilege escalation vulnerability that allows an attacker with an Agent API key to execute arbitrary OS commands on the Paperclip server host.\nAn attacker with an agent credential can escalate privileges from the agent runtime to the Paperclip server host.\nThe vulnerability occurs because agents are allowed to update their own adapterConfig via the /agents/:id API endpoint.\nThe configuration field adapterConfig.workspaceStrategy.provisionCommand is later executed by the server runtime using:\n```\nspawn(\"/bin/sh\", [\"-c\", command])\n```\nAs a result, an attacker controlling an agent credential can inject arbitrary shell commands which are executed by the Paperclip server during workspace provisioning.\nThis breaks the intended trust boundary between agent runtime configuration and server host execution, allowing a compromised or malicious agent to escalate privileges and run commands on the host system.\nThis vulnerability allows remote code execution on the server host.\n\n### Details\n#### Rootcause \nAgent configuration can be modified through the API endpoint:\n```\nPATCH /api/agents/:id\n```\nThe validation schema allows arbitrary configuration fields:\n```\nadapterConfig: z.record(z.unknown())\n```\nThis allows attackers to inject arbitrary keys into the adapter configuration object.\nLater, during workspace provisioning, the server runtime executes a shell command derived directly from this configuration.\nRelevant code path:\n```\nserver/src/services/workspace-runtime.ts\n\nadapterConfig.workspaceStrategy.provisionCommand\n ↓\nprovisionExecutionWorktree()\n ↓\nrunWorkspaceCommand(...)\n ↓\nspawn(\"/bin/sh\", [\"-c\", input.command])\n```\nExample logic:\n```\nconst provisionCommand = asString(input.strategy.provisionCommand, \"\").trim()\n\nawait runWorkspaceCommand({\n command: provisionCommand\n})\n```\nInside runWorkspaceCommand the command is executed using:\n```\nspawn(shell, [\"-c\", input.command])\n```\nBecause no validation, escaping, or allowlist is applied, attacker-controlled configuration becomes a direct OS command execution primitive.\n\n\n#### Affected Files\n```\nserver/src/services/workspace-runtime.ts\n```\nFunctions involved:\n```\nrealizeExecutionWorkspace()\nprovisionExecutionWorktree()\nrunWorkspaceCommand()\n```\n\n#### Attacker Model\nRequired privileges:\nAttacker needs:\n```\nAgent API key\n```\nThis credential is intended for agent automation and should not grant host-level execution privileges.\nAgent credentials may also be exposed to external runtimes, plugins, or third-party agent providers. Allowing such credentials to configure host-executed commands creates a privilege escalation vector.\nNo board or administrator access is required.\n\n#### Attacker Chain\nComplete exploit chain:\n```\nAttacker obtains Agent API key\n ↓\nPATCH /api/agents/:id\n ↓\nInject adapterConfig.workspaceStrategy.provisionCommand\n ↓\nPOST /api/agents/:id/wakeup\n ↓\nServer executes workspace provisioning\n ↓\nworkspace-runtime.ts\n ↓\nspawn(\"/bin/sh -c\")\n ↓\nArbitrary command execution on server host\n```\n\n#### Trust Boundary Violation\nPaperclip’s architecture assumes the following separation:\n```\nAgent runtime\n ↓\nPaperclip control plane\n ↓\nServer host OS\n\nAgents should only perform workflow automation tasks through the orchestration layer.\n\nHowever, because agent-controlled configuration is executed directly by the server runtime, the boundary collapses:\n\nAgent configuration\n ↓\nServer command execution\n```\nThis allows an agent to execute commands outside its intended permissions.\n\n#### Why This Is a Vulnerability (Not Expected Behavior)\nThe provisionCommand field appears intended for trusted operators configuring workspace strategies.\nHowever, the current API design allows agents themselves to modify this configuration.\nBecause agent credentials are designed for automation and may be exposed to agent runtimes, plugins, or external providers, allowing them to configure commands executed by the host introduces a privilege escalation vector.\nTherefore:\n```\nOperator-controlled configuration → expected feature\nAgent-controlled configuration → privilege escalation vulnerability\n```\nThe vulnerability arises from insufficient separation between configuration authority and execution authority.\n\n### PoC\nThe following PoC demonstrates safe command execution by writing a marker file on the server.\nThe PoC does not modify system state beyond creating a file.\n\n#### Step 1 — Setup Environment\nRun Server:\n```\n$env:SHELL = \"C:\\Program Files\\Git\\bin\\sh.exe\"\nnpx paperclipai onboard --yes\n```\n<img width=\"1444\" height=\"699\" alt=\"image\" src=\"https://github.com/user-attachments/assets/44401c6d-ec73-4e59-943a-8635d5115c2c\" />\n\nLogin Claude:\n```\nclaude\n/login\n```\n\n#### Step 2 — Obtain Agent API key\nCreate an agent via the UI or CLI and obtain its API key.\nExample:\n```\npcp_xxxxxxxxxxxxxxxxxxxxx\n```\n<img width=\"1457\" height=\"670\" alt=\"image\" src=\"https://github.com/user-attachments/assets/bb1ab898-cf0b-47b1-865a-127ba6fdc43c\" />\n\n#### Step 3 — Identify agent ID\n```\nGET /api/agents/me\n```\n<img width=\"1463\" height=\"639\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cadea916-9e57-4cf4-a11c-7320a22c4ab6\" />\n\n#### Step 4 — Inject malicious configuration\n```\nPATCH /api/agents/{agentId}\n```\n<img width=\"1476\" height=\"697\" alt=\"image\" src=\"https://github.com/user-attachments/assets/612f7a16-b6d6-418e-bcbe-ce602b711b14\" />\nPayload:\n```\nPS E:\\BucVe\\pocrepo> $patchBody = @{\n>> adapterConfig = @{\n>> workspaceStrategy = @{\n>> type = \"git_worktree\"\n>> provisionCommand = \"echo PAPERCLIP_RCE > poc_rce.txt\"\n>> }\n>> }\n>> } | ConvertTo-Json -Depth 10\n```\n\n#### Step 5 — Trigger execution\n```\nPOST /api/agents/{agentId}/wakeup\n```\n<img width=\"1472\" height=\"675\" alt=\"image\" src=\"https://github.com/user-attachments/assets/268c7322-a5f5-4f3a-a4d4-b43efbecb20e\" />\n\n#### Step 6 — Verify command execution\n<img width=\"1231\" height=\"347\" alt=\"image\" src=\"https://github.com/user-attachments/assets/559c483b-077e-42dd-9309-6a5e5c6a3bdc\" />\nThe marker file appears on the server filesystem:\n```\n~/.paperclip/worktrees/.../poc_rce.txt\n```\nExample content:\n```\nPAPERCLIP_RCE\n```\nThis confirms that attacker-controlled commands executed on the server.\n\n### Impact\nSuccessful exploitation allows:\n```\nRemote command execution on the Paperclip server\n```\nPotential attacker actions:\n```\nread environment variables\nexfiltrate secrets\nmodify repositories\naccess database credentials\nexecute reverse shells\npersist on host\n```\nBecause Paperclip orchestrates multiple agents and repositories, this can lead to full compromise of the deployment environment.\nThis effectively allows a malicious agent to escape the orchestration layer and execute arbitrary commands on the server host.\n\n### Recommended Fix\n1. Restrict configuration authority\nAgents should not be able to modify execution-sensitive configuration fields.\nExample mitigation:\n```\ndeny adapterConfig.workspaceStrategy modification from agent credentials\n```\n2. Server-side allowlist\nOnly allow trusted configuration keys.\nExample:\n```\nadapterConfig.workspaceStrategy.provisionCommand\n\nshould only be configurable by board/admin actors.\n```\n3. Avoid shell execution\nInstead of:\n```\nspawn(\"/bin/sh\", [\"-c\", command])\n```\nprefer:\n```\nspawn(binary, args)\n```\nor a restricted command runner.\n\n4. Input validation\nReject commands containing shell operators:\n```\n|\n&\n;\n$\n`\n```\n5. Sandboxed workspace execution\nWorkspace provisioning should run in a restricted environment (container / sandbox).\n\n### Minimal Patch Suggestion\nOne possible mitigation is to prevent agent principals from modifying execution-sensitive configuration fields such as `workspaceStrategy.provisionCommand`.\nFor example, during agent configuration updates, the server can explicitly reject this field when the request is authenticated using an Agent API key.\nExample TypeScript guard:\n\n```ts\n// reject agent-controlled provisionCommand\nif (\n request.auth?.principal === \"agent\" &&\n body?.adapterConfig?.workspaceStrategy?.provisionCommand\n) {\n throw new Error(\n \"Agents are not permitted to configure workspaceStrategy.provisionCommand\"\n );\n}\n```\nAdditionally, the server should avoid executing arbitrary shell commands derived from configuration values.\nInstead of executing:\n```\nspawn(\"/bin/sh\", [\"-c\", command])\n```\nprefer structured execution:\n```\nspawn(binary, args)\n```\nor restrict the command to a predefined allowlist.\n\n### Security Impact Statement\nAn 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.\n\n### Disclosure\nThis vulnerability was discovered during security research on the Paperclip orchestration runtime.\nThe issue is reported privately to allow maintainers to patch before public disclosure.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@paperclipai/server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2026.416.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/paperclipai/paperclip/security/advisories/GHSA-265w-rf2w-cjh4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41208"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/paperclipai/paperclip"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-16T22:45:26Z",
"nvd_published_at" : "2026-04-23T02:16:18Z"
}
}