T09 · Insecure Skill Coding Practices
- Location
config.json:2- Finding
Live API Credential Committed in Project Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it claims, but it ships a non-placeholder API key and defaults users into a third-party proxy with weak credential handling.
Review before installing. Remove artifact/config.json or replace it with your own local config, rotate any exposed key, prefer GROK_API_KEY or a private config.local.json, verify the endpoint is one you trust, and avoid sending secrets, private code, personal data, or internal URLs as search queries. Pin the install source when possible.
config.json:2Live API Credential Committed in Project Configuration
scripts/grok_search.py:176User Queries Are Silently Sent to a Bundled Third-Party Proxy
scripts/configure.py:35API Credentials Are Stored Without Explicit Permission Hardening and May Be Sent over HTTP
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
headers=headers,
method="POST",
)
with urllib.request.urlopen(req, timeout=timeout_seconds) as resp:
raw = resp.read().decode("utf-8", errors="replace")
try:
return json.loads(raw)
The documented behavior promises real-time web research against a Grok-compatible endpoint and structured JSON output, but the analyzed skill content primarily describes local configuration and invocation flow without evidence of the claimed network/search implementation. This mismatch is security-relevant because users and higher-level agents may trust the skill for external verification while it may instead perform unexpected local actions or fail open in ways that conceal its true behavior.
The skill documentation is written entirely in Chinese and does not indicate that other languages are supported or provide an opt-in choice. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
The README instructs users to install the skill via npx skills add Stemmaker/openclaw-grok-search without pinning a specific version or commit. This creates a supply-chain risk: users may receive a later modified package or dependency set than the one reviewed, and if the upstream package or referenced repo is compromised, arbitrary code could be installed or executed during setup.
The skill advertises executable behavior that involves shell, file access, environment-variable use, and network activity, but it declares no explicit tool scope or permissions boundaries. In an agent ecosystem, this increases the chance of unintended execution with broader privileges than users or orchestrators expect, especially because the skill is project-local and instructs direct command execution.
The activation rule 'You are uncertain and need external confirmation' is overly broad and can cause the skill to run in many routine situations, expanding the frequency of shell execution, config access, and network use. Broad triggering makes benign prompts more likely to invoke a higher-risk capability without strong necessity, increasing exposure to prompt-induced tool use and unnecessary data handling.
The skill instructs users to write configuration interactively and persist it in local project files, creating session persistence that may store API keys or endpoint settings beyond the immediate task. Persistent local secrets and settings increase the risk of later disclosure, misuse by other tools in the workspace, or accidental inclusion in version control.
python scripts/configure.py
The script interactively collects an API key and persists it in plaintext JSON on disk without any explicit warning, masking, or permission hardening. This increases the chance that a user unknowingly stores sensitive credentials in a project directory that may be copied, backed up, shared, or committed to version control, leading to credential disclosure and misuse of the Grok endpoint.
The skill can automatically execute a separate local script when configuration is missing, creating an implicit code-execution path that may surprise users and increase risk if the skill directory or configure.py is tampered with. In an agent context, auto-running helper scripts is more dangerous because installation paths, repositories, or local files may not always be trusted.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
sys.stderr.write("configure.py not found; cannot auto-configure.\n")
return False
try:
run([sys.executable, configure_path], check=True)
except CalledProcessError:
sys.stderr.write("configure.py failed; aborting.\n")
return False
This code sends the user-provided query to a remote OpenAI-compatible endpoint and also allows arbitrary extra headers and body fields to be transmitted. While the behavior is central to the script's purpose, there is no explicit user-facing notice in the code that query contents and configured metadata will be sent over the network.
Allowing arbitrary caller-supplied headers lets a caller override or inject security-relevant HTTP metadata, including Authorization, Host, or proxy-related headers, which can redirect trust or exfiltrate credentials to unintended endpoints. In this skill, that risk is amplified because the same request carries the API key and user query to a configurable remote service.
The manifest presents a focused web research/search tool returning content and sources, but the implementation accepts arbitrary extra JSON merged into the outbound API body. This broadens the effective remote capability beyond the declared search workflow by allowing callers to enable undocumented model/provider-specific features.
The script reads API credentials from environment variables or config files and uses them for outbound authentication, but the code provides no explicit warning or documentation comment about credential handling. This can matter for auditing and operator awareness, especially when credentials are sourced from local config files.
No suspicious patterns detected.