Project Version
latest
Bug Description
Description
I identified a security issue in the clink tool where untrusted user input is forwarded directly to an external AI CLI with file editing capabilities enabled.
This issue allows a remote MCP client to influence a locally executed CLI with filesystem write capabilities.
Affected Code Paths
-
pal-mcp-server/tools/clink.py
CLinkTool.execute() → forwards user-controlled prompt to CLI agent
-
pal-mcp-server/clink/agents/base.py
BaseCLIAgent.run() → executes CLI with provided prompt via subprocess
-
pal-mcp-server/clink/agents/claude.py
- CLI command construction including system prompt injection
-
pal-mcp-server/conf/cli_clients/claude.json
- CLI configured with
--permission-mode acceptEdits
Root Cause
-
Untrusted prompt is passed directly from:
CLinkRequest.prompt → _prepare_prompt_for_role → agent.run(...)
-
CLI is executed with file-edit permissions enabled:
--permission-mode acceptEdits
-
No validation, sandboxing, or path restrictions are enforced before execution
-
No trust boundary enforcement between remote input and local CLI execution context
Impact
- Arbitrary file creation/modification on host filesystem
- Potential code injection into repository
- Risk of downstream execution (CI/CD, imports, scripts)
- No authentication required beyond access to the MCP tool
Why this is a security issue (not expected behavior)
The vulnerability crosses a trust boundary:
- Remote MCP client → local CLI with filesystem access
The application assumes the CLI is safe, but allows attacker-controlled input to drive it without restrictions.
This behavior violates the principle of least privilege and allows untrusted input to control a privileged local execution context.
Recommendation
- Disable
acceptEdits by default
- Add explicit allow-list for editable paths
- Introduce sandboxing or restricted execution mode
- Validate or constrain prompt capabilities before execution
Disclosure
I have submitted this issue to MITRE for CVE consideration and can provide a working PoC and reproduction steps privately if needed.
Note
Note: This issue is unrelated to API provider configuration.
The security reporting channel referenced in SECURITY.md appears to be non-functional (returns 404).
See issue #393.
Because of this, this issue is reported publicly with limited details.
Full technical details and PoC can be shared privately upon request.
Relevant Log Output
No relevant logs. This is a design-level security issue, not a runtime error.
Operating System
Windows
Sanity Checks
Project Version
latest
Bug Description
Description
I identified a security issue in the
clinktool where untrusted user input is forwarded directly to an external AI CLI with file editing capabilities enabled.This issue allows a remote MCP client to influence a locally executed CLI with filesystem write capabilities.
Affected Code Paths
pal-mcp-server/tools/clink.pyCLinkTool.execute()→ forwards user-controlledpromptto CLI agentpal-mcp-server/clink/agents/base.pyBaseCLIAgent.run()→ executes CLI with provided prompt via subprocesspal-mcp-server/clink/agents/claude.pypal-mcp-server/conf/cli_clients/claude.json--permission-mode acceptEditsRoot Cause
Untrusted prompt is passed directly from:
CLI is executed with file-edit permissions enabled:
No validation, sandboxing, or path restrictions are enforced before execution
No trust boundary enforcement between remote input and local CLI execution context
Impact
Why this is a security issue (not expected behavior)
The vulnerability crosses a trust boundary:
The application assumes the CLI is safe, but allows attacker-controlled input to drive it without restrictions.
This behavior violates the principle of least privilege and allows untrusted input to control a privileged local execution context.
Recommendation
acceptEditsby defaultDisclosure
I have submitted this issue to MITRE for CVE consideration and can provide a working PoC and reproduction steps privately if needed.
Note
Note: This issue is unrelated to API provider configuration.
The security reporting channel referenced in SECURITY.md appears to be non-functional (returns 404).
See issue #393.
Because of this, this issue is reported publicly with limited details.
Full technical details and PoC can be shared privately upon request.
Relevant Log Output
Operating System
Windows
Sanity Checks
GEMINI_API_KEYOPENAI_API_KEYOPENROUTER_API_KEYCUSTOM_API_URL