native-web-search
Warn
Audited by Gen Agent Trust Hub on May 10, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONCREDENTIALS_UNSAFEDATA_EXFILTRATIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
resolveConfigValuefunction insearch.mjsusesexecSyncto run shell commands whenever a configuration value (such as a key inauth.json) begins with an exclamation mark (!). This feature, intended to allow secret retrieval from vaults or CLI tools, permits arbitrary command execution if an attacker can influence the contents of the local configuration. - [REMOTE_CODE_EXECUTION]: The script performs dynamic loading of the
@mariozechner/pi-aimodule usingimport()on computed paths. ThecollectModuleCandidatesfunction searches for this module in several locations, including the current working directory (cwd) and its parents, which could lead to the execution of malicious code if the skill is run within a directory containing a craftednode_modulesstructure. - [CREDENTIALS_UNSAFE]: The skill reads and writes sensitive authentication data, including API keys and OAuth tokens, to a local file at
~/.pi/agent/auth.json. - [DATA_EXFILTRATION]: The script transmits authentication credentials and query data to the official API endpoints of OpenAI (
chatgpt.com) and Anthropic (api.anthropic.com) to perform search tasks. - [PROMPT_INJECTION]: The skill is susceptible to indirect prompt injection as it ingests untrusted search results from external models and prints them to the console without sanitization or boundary markers. Since the script also has the ability to write to configuration files and execute shell commands, malicious content in search results could potentially influence the agent to perform unsafe operations.
- Ingestion points:
runCodexSearchandrunAnthropicSearchfunctions insearch.mjsingest data retrieved from external web searches. - Boundary markers: Absent around the model output displayed to the agent.
- Capability inventory: Shell command execution (
execSync), local file system writes (writeFileSync), and network operations (fetch). - Sanitization: No validation, escaping, or filtering is applied to the retrieved search content before display.
Audit Metadata