GHSA-3pw3-v88x-xj24: Paperclip Arbitrary File Read Vulnerability

MODERATE
CVSS 6.5
CWE-73
Published
Advisory Summary

GHSA-3pw3-v88x-xj24 is a MODERATE (CVSS 6.5) arbitrary file read vulnerability (CWE-73: External Control of File Name or Path) affecting Paperclip libraries in the npm ecosystem. The issue involves arbitrary file read via agent-controlled adapterconfig.instructionsfilepath. Remediation is available by upgrading affected packages to version 2026.416.0.

GHSA-3pw3-v88x-xj24 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3pw3-v88x-xj24
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Paperclip
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-3pw3-v88x-xj24

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.

@paperclipai/shared fixed: 2026.416.0
npm install @paperclipai/shared@2026.416.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @paperclipai/shared

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-3pw3-v88x-xj24, inspect your project dependencies using npm:

npm ls @paperclipai/shared

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/shared 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-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. 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

### Summary Paperclip contains an arbitrary file read vulnerability that allows an attacker with an Agent API key to read files from the Paperclip server host filesystem. The vulnerability occurs because agents are allowed to modify their own adapterConfig through the /agents/:id API endpoint. The configuration field adapterConfig.instructionsFilePath is later read directly by the server runtime using fs.readFile(). Because no validation or path restriction is applied, an attacker can supply an arbitrary filesystem path. The Paperclip server then attempts to read that path from the host filesystem during agent execution. This breaks the intended trust boundary between agent runtime configuration and server host filesystem access, allowing a compromised or malicious agent to access sensitive files on the host system. ### Details #### Root Cause No path normalization, allowlist, or workspace boundary validation is applied before the filesystem read occurs. Agent configuration can be modified through the API endpoint: ``` PATCH /api/agents/:id ``` The validation schema allows arbitrary configuration fields inside adapterConfig. File: ``` packages/shared/src/validators/agent.ts ``` Schema fragment: ``` adapterConfig: z.record(z.unknown()) ``` Because of this schema, attackers can inject arbitrary configuration values, including: ``` adapterConfig.instructionsFilePath ``` During agent execution, the server runtime reads this path directly from the host filesystem using fs.readFile(). Relevant code path: ``` packages/adapters/claude-local/src/server/execute.ts ``` Execution flow: ``` adapterConfig.instructionsFilePath ↓ execute() ↓ fs.readFile(instructionsFilePath) ↓ file content loaded into runtime ``` Vulnerable logic: ``` const instructionsContent = await fs.readFile(instructionsFilePath, "utf-8"); ``` Because the value originates from attacker-controlled configuration and no validation or sandboxing is applied, this becomes a direct host filesystem read primitive. #### Affected Files Primary vulnerable file: ``` packages/adapters/claude-local/src/server/execute.ts ``` Relevant function: ``` execute() ``` Sensitive operation: ``` fs.readFile(instructionsFilePath) ``` Configuration source: ``` PATCH /api/agents/:id ``` Validation logic: ``` packages/shared/src/validators/agent.ts ``` #### Attacker Model Required privileges Attacker requires: ``` Agent API key ``` Agent credentials are intended for automation and integration with external runtimes. These credentials are commonly used by: ``` agent runtime environments third-party integrations automation pipelines ``` Agent credentials are not intended to grant direct access to the server host filesystem. No board or administrator privileges are required. #### Attacker Chain Complete exploit chain: ``` Attacker obtains Agent API key ↓ PATCH /api/agents/:id ↓ Inject adapterConfig.instructionsFilePath ↓ POST /api/agents/:id/wakeup ↓ Server executes agent run ↓ execute.ts ↓ fs.readFile(attacker_path) ↓ Server reads host filesystem path ``` This allows an attacker to read arbitrary files accessible to the Paperclip server process. #### Trust Boundary Violation Paperclip’s architecture assumes the following separation: ``` Agent runtime ↓ Paperclip orchestration layer ↓ Server host filesystem Agents should only interact with repositories and workflows through the orchestration layer. However, because agent-controlled configuration is passed directly into fs.readFile, the boundary collapses: Agent configuration ↓ Server filesystem access ``` This allows an agent to access files outside its intended permission scope. #### Why This Is a Vulnerability (Not Expected Behavior) The instructionsFilePath configuration appears intended for trusted operators configuring agent runtime behavior. However, the current API design allows agents themselves to modify this configuration through the agent API. Because agent credentials may be exposed to external systems or runtime environments, allowing them to control server filesystem paths introduces a security vulnerability. Therefore: ``` Operator-controlled configuration → expected feature Agent-controlled configuration → arbitrary file read vulnerability ``` The issue arises from insufficient separation between configuration authority and filesystem access authority. ### PoC The following PoC demonstrates that the server attempts to read an attacker-controlled filesystem path. To avoid accessing sensitive data, the PoC uses a non-existent path. #### Step 1 — Setup Environment Run server: ``` $env:SHELL = "C:\Program Files\Git\bin\sh.exe" npx paperclipai onboard --yes ``` Login Claude: ``` claude /login ``` #### Step 2 — Obtain Agent API key Create an agent via the UI or CLI and obtain its API key. Example: <img width="1475" height="710" alt="image" src="https://github.com/user-attachments/assets/fcc0dfe9-1271-4eed-af0a-7dd83dfa9ad4" /> #### Step 3 — Identify agent ID ``` GET /api/agents/me ``` <img width="824" height="196" alt="image" src="https://github.com/user-attachments/assets/af4a16bb-9bff-485d-af23-4a85d31486fc" /> #### Step 4 — Inject malicious configuration ``` PATCH /api/agents/{agentId} ``` Payload example: ```powershell { "adapterConfig": { "instructionsFilePath": "C:\\definitely-does-not-exist-paperclip-poc.txt" } } ``` Example PowerShell payload: ```powershell $patchBody = @{ adapterConfig = @{ instructionsFilePath = "C:\definitely-does-not-exist-paperclip-poc.txt" } } | ConvertTo-Json -Depth 10 ``` <img width="1891" height="963" alt="image" src="https://github.com/user-attachments/assets/1a8c41b4-c053-4498-8bf5-ce41c7dfa1b5" /> Step 5 — Trigger execution ``` POST /api/agents/{agentId}/wakeup ``` <img width="927" height="376" alt="image" src="https://github.com/user-attachments/assets/d6107b64-1b5e-493c-9a66-45a4713260b5" /> #### Step 6 — Observe server log Server log shows: ``` ENOENT: no such file or directory, open 'C:\definitely-does-not-exist-paperclip-poc.txt' at async Object.readFile at async Object.execute (.../adapter-claude-local/dist/server/execute.js) ``` This confirms the server attempted to read an attacker-controlled filesystem path. <img width="1916" height="166" alt="image" src="https://github.com/user-attachments/assets/2470438a-bf5a-4f6f-848c-b134d3f0cc3f" /> ### Impact Successful exploitation allows attackers to read sensitive files accessible to the Paperclip server process. Examples of potentially exposed data include: ``` environment configuration (.env) SSH private keys database credentials API tokens CI secrets ``` Possible attacker actions: ``` exfiltrate secrets access private repositories steal infrastructure credentials pivot into connected services ``` Because Paperclip orchestrates repositories, agents, and automation tasks, disclosure of such secrets may lead to compromise of the broader deployment environment. ### Recommended Fix #### Restrict configuration authority Agents should not be allowed to modify filesystem-sensitive configuration fields. Example mitigation: ``` adapterConfig.instructionsFilePath ``` should only be configurable by board/admin actors. #### Path validation Restrict file access to a safe directory such as: ``` workspace/ agent-config/ ``` Reject: ``` absolute paths system directories paths containing ".." ``` #### Avoid direct filesystem reads from configuration Instead of: ``` fs.readFile(user_supplied_path) ``` use: ``` readFile(workspaceSafePath) ``` Example guard ```ts if ( request.auth?.principal === "agent" && body?.adapterConfig?.instructionsFilePath ) { throw new Error( "Agents are not permitted to configure instructionsFilePath" ); } ``` ### Security Impact Statement An authenticated attacker with an Agent API key can modify their agent configuration to inject an arbitrary filesystem path into adapterConfig.instructionsFilePath. The Paperclip server reads this path during agent execution via fs.readFile, allowing the attacker to access files on the server host filesystem. ### Disclosure This vulnerability was discovered during security research on the Paperclip orchestration runtime and is reported privately to allow maintainers to patch the issue before public disclosure.

GHSA-3pw3-v88x-xj24 Affected Paperclip Versions

1 component(s)
Fixed Versions:
2026.416.0
Product / Package Ecosystem Affected Versions Fixed Version
@paperclipai/shared
npm
< 2026.416.0
2026.416.0

References

Frequently Asked Questions

What is GHSA-3pw3-v88x-xj24?
GHSA-3pw3-v88x-xj24 is a security vulnerability in Paperclip involving Arbitrary File Read via Agent-Controlled adapterConfig.instructionsFilePath under CWE-73: External Control of File Name or Path.
Which Paperclip versions are affected?
Affected versions include releases prior to 2026.416.0 across affected packages: @paperclipai/shared.
What version fixes GHSA-3pw3-v88x-xj24?
Upgrading to 2026.416.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @paperclipai/shared affected?
Yes, @paperclipai/shared is affected in releases prior to 2026.416.0. Upgrade your dependency to 2026.416.0 or later.
What is the CVSS score of GHSA-3pw3-v88x-xj24?
GHSA-3pw3-v88x-xj24 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-3pw3-v88x-xj24?
GHSA-3pw3-v88x-xj24 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check npm dependencies for GHSA-3pw3-v88x-xj24?
Run the dependency tree command: 'npm ls @paperclipai/shared'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3pw3-v88x-xj24",
  "modified" : "2026-04-16T22:45:14Z",
  "published" : "2026-04-16T22:45:14Z",
  "aliases" : [ ],
  "summary" : "Paperclip: Arbitrary File Read via Agent-Controlled adapterConfig.instructionsFilePath",
  "details" : "### Summary\nPaperclip contains an arbitrary file read vulnerability that allows an attacker with an Agent API key to read files from the Paperclip server host filesystem.\nThe vulnerability occurs because agents are allowed to modify their own adapterConfig through the /agents/:id API endpoint.\nThe configuration field adapterConfig.instructionsFilePath is later read directly by the server runtime using fs.readFile().\nBecause no validation or path restriction is applied, an attacker can supply an arbitrary filesystem path.\nThe Paperclip server then attempts to read that path from the host filesystem during agent execution.\nThis breaks the intended trust boundary between agent runtime configuration and server host filesystem access, allowing a compromised or malicious agent to access sensitive files on the host system.\n\n### Details\n#### Root Cause\nNo path normalization, allowlist, or workspace boundary validation is applied before the filesystem read occurs.\nAgent configuration can be modified through the API endpoint:\n```\nPATCH /api/agents/:id\n```\nThe validation schema allows arbitrary configuration fields inside adapterConfig.\nFile:\n```\npackages/shared/src/validators/agent.ts\n```\nSchema fragment:\n```\nadapterConfig: z.record(z.unknown())\n```\nBecause of this schema, attackers can inject arbitrary configuration values, including:\n```\nadapterConfig.instructionsFilePath\n```\nDuring agent execution, the server runtime reads this path directly from the host filesystem using fs.readFile().\nRelevant code path:\n```\npackages/adapters/claude-local/src/server/execute.ts\n```\nExecution flow:\n```\nadapterConfig.instructionsFilePath\n        ↓\nexecute()\n        ↓\nfs.readFile(instructionsFilePath)\n        ↓\nfile content loaded into runtime\n```\nVulnerable logic:\n```\nconst instructionsContent = await fs.readFile(instructionsFilePath, \"utf-8\");\n```\nBecause the value originates from attacker-controlled configuration and no validation or sandboxing is applied, this becomes a direct host filesystem read primitive.\n\n#### Affected Files\nPrimary vulnerable file:\n```\npackages/adapters/claude-local/src/server/execute.ts\n```\nRelevant function:\n```\nexecute()\n```\nSensitive operation:\n```\nfs.readFile(instructionsFilePath)\n```\nConfiguration source:\n```\nPATCH /api/agents/:id\n```\nValidation logic:\n```\npackages/shared/src/validators/agent.ts\n```\n\n#### Attacker Model\nRequired privileges\nAttacker requires:\n```\nAgent API key\n```\nAgent credentials are intended for automation and integration with external runtimes.\nThese credentials are commonly used by:\n```\nagent runtime environments\nthird-party integrations\nautomation pipelines\n```\nAgent credentials are not intended to grant direct access to the server host filesystem.\nNo board or administrator privileges are required.\n\n#### Attacker Chain\nComplete exploit chain:\n```\nAttacker obtains Agent API key\n        ↓\nPATCH /api/agents/:id\n        ↓\nInject adapterConfig.instructionsFilePath\n        ↓\nPOST /api/agents/:id/wakeup\n        ↓\nServer executes agent run\n        ↓\nexecute.ts\n        ↓\nfs.readFile(attacker_path)\n        ↓\nServer reads host filesystem path\n```\nThis allows an attacker to read arbitrary files accessible to the Paperclip server process.\n\n#### Trust Boundary Violation\nPaperclip’s architecture assumes the following separation:\n```\nAgent runtime\n        ↓\nPaperclip orchestration layer\n        ↓\nServer host filesystem\n\nAgents should only interact with repositories and workflows through the orchestration layer.\n\nHowever, because agent-controlled configuration is passed directly into fs.readFile, the boundary collapses:\n\nAgent configuration\n        ↓\nServer filesystem access\n```\nThis allows an agent to access files outside its intended permission scope.\n\n#### Why This Is a Vulnerability (Not Expected Behavior)\nThe instructionsFilePath configuration appears intended for trusted operators configuring agent runtime behavior.\nHowever, the current API design allows agents themselves to modify this configuration through the agent API.\nBecause agent credentials may be exposed to external systems or runtime environments, allowing them to control server filesystem paths introduces a security vulnerability.\nTherefore:\n```\nOperator-controlled configuration → expected feature\nAgent-controlled configuration → arbitrary file read vulnerability\n```\nThe issue arises from insufficient separation between configuration authority and filesystem access authority.\n\n### PoC\nThe following PoC demonstrates that the server attempts to read an attacker-controlled filesystem path.\nTo avoid accessing sensitive data, the PoC uses a non-existent path.\n#### Step 1 — Setup Environment\nRun server:\n```\n$env:SHELL = \"C:\\Program Files\\Git\\bin\\sh.exe\"\nnpx paperclipai onboard --yes\n```\nLogin Claude:\n```\nclaude\n/login\n```\n#### Step 2 — Obtain Agent API key\nCreate an agent via the UI or CLI and obtain its API key.\nExample:\n<img width=\"1475\" height=\"710\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fcc0dfe9-1271-4eed-af0a-7dd83dfa9ad4\" />\n\n#### Step 3 — Identify agent ID\n```\nGET /api/agents/me\n```\n<img width=\"824\" height=\"196\" alt=\"image\" src=\"https://github.com/user-attachments/assets/af4a16bb-9bff-485d-af23-4a85d31486fc\" />\n\n#### Step 4 — Inject malicious configuration\n```\nPATCH /api/agents/{agentId}\n```\nPayload example:\n```powershell\n{\n  \"adapterConfig\": {\n    \"instructionsFilePath\": \"C:\\\\definitely-does-not-exist-paperclip-poc.txt\"\n  }\n}\n```\nExample PowerShell payload:\n```powershell\n$patchBody = @{\n  adapterConfig = @{\n    instructionsFilePath = \"C:\\definitely-does-not-exist-paperclip-poc.txt\"\n  }\n} | ConvertTo-Json -Depth 10\n```\n<img width=\"1891\" height=\"963\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1a8c41b4-c053-4498-8bf5-ce41c7dfa1b5\" />\n\nStep 5 — Trigger execution\n```\nPOST /api/agents/{agentId}/wakeup\n```\n<img width=\"927\" height=\"376\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d6107b64-1b5e-493c-9a66-45a4713260b5\" />\n\n#### Step 6 — Observe server log\nServer log shows:\n```\nENOENT: no such file or directory, open 'C:\\definitely-does-not-exist-paperclip-poc.txt'\n    at async Object.readFile\n    at async Object.execute (.../adapter-claude-local/dist/server/execute.js)\n```\nThis confirms the server attempted to read an attacker-controlled filesystem path.\n<img width=\"1916\" height=\"166\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2470438a-bf5a-4f6f-848c-b134d3f0cc3f\" />\n\n### Impact\nSuccessful exploitation allows attackers to read sensitive files accessible to the Paperclip server process.\nExamples of potentially exposed data include:\n```\nenvironment configuration (.env)\nSSH private keys\ndatabase credentials\nAPI tokens\nCI secrets\n```\nPossible attacker actions:\n```\nexfiltrate secrets\naccess private repositories\nsteal infrastructure credentials\npivot into connected services\n```\nBecause Paperclip orchestrates repositories, agents, and automation tasks, disclosure of such secrets may lead to compromise of the broader deployment environment.\n\n### Recommended Fix\n#### Restrict configuration authority\nAgents should not be allowed to modify filesystem-sensitive configuration fields.\nExample mitigation:\n```\nadapterConfig.instructionsFilePath\n```\nshould only be configurable by board/admin actors.\n\n#### Path validation\nRestrict file access to a safe directory such as:\n```\nworkspace/\nagent-config/\n```\nReject:\n```\nabsolute paths\nsystem directories\npaths containing \"..\"\n```\n\n#### Avoid direct filesystem reads from configuration\nInstead of:\n```\nfs.readFile(user_supplied_path)\n```\nuse:\n```\nreadFile(workspaceSafePath)\n```\nExample guard\n```ts\nif (\n  request.auth?.principal === \"agent\" &&\n  body?.adapterConfig?.instructionsFilePath\n) {\n  throw new Error(\n    \"Agents are not permitted to configure instructionsFilePath\"\n  );\n}\n```\n\n### Security Impact Statement\nAn authenticated attacker with an Agent API key can modify their agent configuration to inject an arbitrary filesystem path into adapterConfig.instructionsFilePath.\nThe Paperclip server reads this path during agent execution via fs.readFile, allowing the attacker to access files on the server host filesystem.\n\n### Disclosure\nThis vulnerability was discovered during security research on the Paperclip orchestration runtime and is reported privately to allow maintainers to patch the issue before public disclosure.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@paperclipai/shared"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.416.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/paperclipai/paperclip/security/advisories/GHSA-3pw3-v88x-xj24"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/paperclipai/paperclip"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T22:45:14Z",
    "nvd_published_at" : null
  }
}