electrobun-rpc-patterns

Fail

Audited by Gen Agent Trust Hub on Sep 16, 2026

Risk Level: HIGHCOMMAND_EXECUTIONDATA_EXFILTRATIONINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill provides an executeCommand RPC handler pattern in src/bun/main.ts that uses Bun.spawn([cmd, ...args]). This implementation allows the unprivileged webview process to execute arbitrary shell commands on the host system with the permissions of the main application process.
  • [DATA_EXFILTRATION]: The streamFile and listFiles handlers in the main process allow the webview to request directory listings and file contents. The provided code lacks validation to restrict these operations to safe or designated directories, enabling unauthorized access to sensitive system files.
  • [DYNAMIC_EXECUTION]: The patterns demonstrate the dynamic execution of commands and file operations using input directly supplied by an external process (the webview) without sufficient sanitization or security controls.
  • [INDIRECT_PROMPT_INJECTION]: The skill establishes a high-privilege execution surface that is vulnerable to instructions sent from a lower-privilege context.
  • Ingestion points: RPC handler methods in src/bun/main.ts and src/types/rpc.ts that accept string parameters for commands and file paths.
  • Boundary markers: None; there are no clear delimiters or instructions for the agent to treat the RPC payloads as untrusted data.
  • Capability inventory: The main process handlers include capabilities for subprocess spawning (Bun.spawn), file writing (Bun.write), file reading (Bun.file), and directory traversal (fs.readdir).
  • Sanitization: A basic path check (path.includes("..")) is included in one example for saveFile, but no validation or sanitization is present in the executeCommand, streamFile, or listFiles examples.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Sep 16, 2026, 01:49 AM