T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/shared.mjs:23- Finding
Overbroad Access to Shared Credential Files
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is useful for Grok search and chat, but it can mix user-level API credentials with workspace-controlled endpoints, which deserves careful review before installation.
Install only if you trust the workspaces where it will run and the endpoint you configure. Prefer official xAI endpoints with an explicitly provided key, avoid using sensitive prompts or images with third-party proxies, and do not let untrusted projects supply .env values such as XAI_BASE_URL.
scripts/shared.mjs:23Overbroad Access to Shared Credential Files
scripts/shared.mjs:47Workspace-Controlled API Endpoint Can Receive a Separately Sourced Official Credential and Private User Data
Reading process.cwd()/.env gives the skill access to any secrets present in the current working directory, not just keys dedicated to this integration. In an agent environment, that can unintentionally expose unrelated credentials and expands the blast radius far beyond simple search functionality.
export function loadEnvFiles() {
const candidates = [
path.join(process.cwd(), ".env"),
path.join(os.homedir(), ".openclaw", ".env"),
];
const loaded = {};
Reading ~/.openclaw/.env accesses persistent user-level secrets outside the skill boundary. Combined with support for custom Grok-compatible proxies, this can enable silent reuse of a user's API key with a third-party service, creating a significant credential exposure risk.
export function loadEnvFiles() {
const candidates = [
path.join(process.cwd(), ".env"),
path.join(os.homedir(), ".openclaw", ".env"),
];
const loaded = {};
for (const p of candidates) {
The skill advertises functionality that uses environment variables and outbound network access, but the manifest does not declare any tool scope or permission boundaries. This weakens reviewability and policy enforcement because an agent or operator cannot easily see that the skill may read credentials and send data to external services before use.
The documentation encourages use of public-benefit sites or third-party Grok-compatible proxies, but does not clearly warn that prompts, search queries, images, metadata, and possibly API credentials may be disclosed to untrusted operators. In this skill's context, users may send sensitive research terms or uploaded images through those intermediaries, creating a meaningful privacy and data-handling risk.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`
## 2)公益站 / 第三方 Grok 兼容代理模式
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
```
默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`
## 2)公益站 / 第三方 Grok 兼容代理模式
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
```
默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`
## 2)公益站 / 第三方 Grok 兼容代理模式
The documentation explicitly encourages use of third-party or public proxy endpoints for Grok-compatible APIs and instructs users to place proxy API keys in automatically loaded .env files, but it provides no warning that prompts, search queries, account metadata, and credentials may be exposed to untrusted operators. In this skill context, that omission materially increases the chance that users will unknowingly route sensitive data through non-official infrastructure with weaker security, logging, or retention practices.
The manifest describes a skill for web_search and x_search through Grok-compatible APIs, but this file is documented and implemented as a general-purpose chat client with optional image attachments. Nothing in the script constrains use to web/X search, so its actual behavior is broader than the declared search-focused purpose.
The helper reads secrets from user-scoped files outside the skill directory, including ~/.openclaw/.env and ~/.clawdbot/clawdbot.json, then reuses them for this skill. That broad credential discovery exceeds the narrow web/X search purpose and can silently appropriate unrelated stored API keys, especially when the skill also supports arbitrary third-party Grok-compatible endpoints.
The code silently loads API keys from environment variables and local config files without any disclosure in the file or a visible consent boundary. In a skill that can target custom base URLs, this creates a risk that a user's existing xAI key is used and potentially sent to an unintended remote service.