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
executeCommandRPC handler pattern insrc/bun/main.tsthat usesBun.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
streamFileandlistFileshandlers 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.tsandsrc/types/rpc.tsthat 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 forsaveFile, but no validation or sanitization is present in theexecuteCommand,streamFile, orlistFilesexamples.
Recommendations
- AI detected serious security threats
Audit Metadata