Back to skill

Security audit

idea-inbox

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated idea-inbox purpose, but it automatically reads global Codex/OpenClaw model credentials and sends private idea text to Feishu and a model provider, so it needs user review before installation.

Install only if you are comfortable with the skill reading your Codex/OpenClaw model configuration, using those credentials to call a model provider, sending private idea messages to Feishu and that provider, creating a Bitable app, and saving local config. Prefer dedicated low-privilege model and Feishu credentials, review the saved config file permissions, and avoid using it for highly sensitive ideas unless the provider and workspace retention policies are acceptable.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/idea_inbox_config.py:66
Finding

Sensitive Configuration File Is Written Without Restrictive Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/idea_inbox_config.py, lines 66-68
Vulnerability Type: CWE-732 — Incorrect Permission Assignment for Critical Resource
Risk Level: Medium

Vulnerable Code

python
def save_config(cfg: dict[str, Any]) -> None:
    CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True)
    CONFIG_PATH.write_text(json.dumps(cfg, ensure_ascii=False, indent=2), encoding="utf-8")

Technical Analysis

The configuration is written using Path.write_text() without explicitly setting owner-only permissions on either the configuration directory or file. Consequently, the resulting permissions depend on the process umask.

The documented configuration can contain a Bitable application token and an optional fallback model API key. If the process runs with a permissive umask, another local account may be able to read ~/.openclaw/idea-inbox/config.json. Existing files with insecure permissions also remain insecure when overwritten because the implementation does not correct their mode.

Attack Path

  1. A user configures the Skill with a Bitable token or fallback model API key.
  2. save_config() creates or updates the configuration without enforcing restrictive permissions.
  3. The host has a permissive umask, or the configuration file already has group- or world-readable permissions.
  4. Another local user reads ~/.openclaw/idea-inbox/config.json.
  5. The attacker reuses any exposed API credentials or resource identifiers according to the permissions granted by the corresponding external service.

This attack requires local filesystem access under an account that can read the resulting file. Its feasibility therefore depends on the host's umask, existing file permissions, and account isolation.

Impact Assessment

A successful attacker could consume model API quota or invoke model APIs with the exposed key. If the stored Bitable values provide or can be combined with ...[truncated 270 chars]

Remediation
View remediation

Remediation Suggestions

  • Create the configuration directory with owner-only permissions (0700).
  • Create configuration files with mode 0600, independent of the process umask.
  • Write updates to an owner-only temporary file in the same directory, flush and synchronize it, then atomically replace the destination.
  • Explicitly apply chmod(0o600) after replacement so pre-existing files with unsafe permissions are corrected.
  • Store API keys in an operating-system credential store or another protected secret manager instead of plaintext JSON where possible.
  • Validate that the configured path is not a symbolic link before writing if untrusted local users can modify the parent path.

Example hardening approach:

python
def save_config(cfg: dict[str, Any]) -> None:
    CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True, mode=0o700)
    CONFIG_PATH.parent.chmod(0o700)

    data = json.dumps(cfg, ensure_ascii=False, indent=2)
    temp_path = CONFIG_PATH.with_suffix(".tmp")

    fd = os.open(temp_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
    try:
        with os.fdopen(fd, "w", encoding="utf-8") as handle:
            handle.write(data)
            handle.flush()
            os.fsync(handle.fileno())
        os.replace(temp_path, CONFIG_PATH)
        CONFIG_PATH.chmod(0o600)
    finally:
        if temp_path.exists():
            temp_path.unlink()
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (22)

Tainted flow: 'text' from sys.stdin.read (line 46, user input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/classify_entry.py (reported line 14)May include surrounding context.

python
def _run(cmd: list[str], text: str) -> dict:
    import subprocess

    p = subprocess.run(cmd, input=text.encode("utf-8"), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out = p.stdout.decode("utf-8", errors="replace").strip()
    if p.returncode != 0:
        raise RuntimeError((out or p.stderr.decode("utf-8", errors="replace")).strip() or "classify failed")

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

The skill explicitly prefers reading authentication and configuration material from ~/.codex/auth.json and ~/.codex/config.toml, which are agent-level sensitive files outside the skill's own configuration scope. Accessing those files grants the skill visibility into broader model credentials or agent configuration, increasing the risk of credential theft, cross-skill privilege abuse, and unauthorized use of the user's AI account.

Content

Scanner excerpt · README.md (reported line 24)May include surrounding context.

md
## Model auth

- Prefers `~/.codex/auth.json` + `~/.codex/config.toml` (do **not** read API keys from env).
- Optional fallback model config can be placed into `config.json`.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding again highlights that the advertised workflow is not implemented, while actual behavior appears to be only a setup placeholder. Such deception or severe incompleteness is a security problem because operators cannot reliably assess what the skill will access, transmit, or fail to do, which undermines trust boundaries and auditability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding again highlights that the advertised workflow is not implemented, while actual behavior appears to be only a setup placeholder. Such deception or severe incompleteness is a security problem because operators cannot reliably assess what the skill will access, transmit, or fail to do, which undermines trust boundaries and auditability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding again highlights that the advertised workflow is not implemented, while actual behavior appears to be only a setup placeholder. Such deception or severe incompleteness is a security problem because operators cannot reliably assess what the skill will access, transmit, or fail to do, which undermines trust boundaries and auditability.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
98% confidence
Finding

The skill explicitly states it reads ~/.codex/auth.json and ~/.codex/config.toml to obtain model provider settings and credentials. Accessing agent config and auth material is highly sensitive because those files may contain API keys or tokens unrelated to this skill, enabling credential exposure, cross-service abuse, or unintended lateral access if the skill is compromised or overly broad.

Content

Scanner excerpt · SKILL.md (reported line 67)May include surrounding context.

text

- `daily_time`:仅需配置每日时间;`send_if_zero` 固定为 false(0 新增不发)。
- 模型:默认优先读取 `~/.codex/auth.json` + `~/.codex/config.toml`(不读 env)。
  - 若用户没有 codex 文件,可在 `model.fallback` 填 `baseUrl/apiKey/apiType/model`。

## Inputs

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The classify flow depends on helper functions that access ~/.codex/config.toml and ~/.codex/auth.json to obtain provider endpoints and API keys, meaning this skill can leverage sensitive agent config material outside its own directory. In an agent ecosystem, access to another tool’s auth/config store weakens isolation and can enable unauthorized use of paid accounts or data egress via attacker-chosen providers configured in those files.

Content

Scanner excerpt · scripts/idea_inbox_ai.py (reported line 215)May include surrounding context.

python
def classify(text: str, prompt_path: str | None = None, model: str | None = None) -> dict[str, Any]:
    provider_pick = _pick_provider(model)
    if not provider_pick:
        raise RuntimeError("No model provider found. Check ~/.codex/config.toml and ~/.codex/auth.json")

    provider, model_id, api_type = provider_pick
    instructions, prompt_tpl = _load_prompt(Path(prompt_path) if prompt_path else None)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/idea_inbox_config.py (reported line 43)May include surrounding context.

python
},
    "ai": {"enabled": True, "fallback_mode": "rules"},
    "model": {
        # codex_files_first: prefer ~/.codex/auth.json + ~/.codex/config.toml
        "mode": "codex_files_first",
        # optional fallback:
        # {"baseUrl": "...", "apiKey": "...", "api": "openai-responses"|"openai-completions", "model": "...", "authHeader": true, "headers": {}}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README states that the skill will automatically create a Feishu/Lark Bitable app and persist configuration under the user's home directory, but it does not clearly warn users that running the skill causes external state changes and local filesystem writes. In an agent context, silent side effects can violate user expectations, lead to unauthorized workspace modifications, and create persistent artifacts containing sensitive configuration.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill describes capabilities that require file access, network access, and likely model invocation, but it declares no explicit tool scope or permissions. In an agent environment, undeclared capabilities reduce transparency and can allow a skill to access local files or external services without clear user consent or platform enforcement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill processes private direct messages and states that content will be stored in Feishu Bitable and analyzed by a model, but it does not prominently warn users that private chat content may be transmitted to external services. In this context, omission of that disclosure increases privacy and compliance risk because sensitive ideas or personal data may leave the original chat environment unexpectedly.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/classify_entry.py (reported line 14)May include surrounding context.

python
def _run(cmd: list[str], text: str) -> dict:
    import subprocess

    p = subprocess.run(cmd, input=text.encode("utf-8"), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out = p.stdout.decode("utf-8", errors="replace").strip()
    if p.returncode != 0:
        raise RuntimeError((out or p.stderr.decode("utf-8", errors="replace")).strip() or "classify failed")

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script is explicitly designed to read provider configuration and API credentials from user-level ~/.codex and ~/.openclaw files, which are unrelated to this skill’s own configuration boundary. That creates a cross-context secret access issue: a skill can silently inherit and use credentials the user configured for other tools, enabling unintended remote API usage and reducing least-privilege isolation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The category enum is hard-coded in Chinese, and the prompts sent to the model explicitly instruct it in Chinese to output strict JSON. This imposes a locale/language constraint without any user opt-in or documented justification, which matches the language policy violation category.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script reads arbitrary stdin content and transmits it to a remote model endpoint selected from local config, with no disclosure, confirmation, or data classification checks. In this skill’s context, inboxed ideas may contain sensitive business, product, or personal information, so silent exfiltration to a third-party model provider is a real confidentiality risk.

Content

No source excerpt is available for this finding.

Tainted flow: 'CONFIG_PATH' from os.environ.get (line 10, credential/environment) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/idea_inbox_config.py (reported line 68)May include surrounding context.

python
def save_config(cfg: dict[str, Any]) -> None:
    CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True)
    CONFIG_PATH.write_text(json.dumps(cfg, ensure_ascii=False, indent=2), encoding="utf-8")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code defines categories, tags, regex rules, and example prefixes entirely in Chinese, which effectively forces a specific language/locale in the skill behavior. The file provides no user opt-in, fallback, or documented justification for this locale restriction, which matches the policy-violation category for language or locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The README specifies activation only for messages starting with idea: or 灵感:, which constrains use to English and Chinese forms without stating whether users can choose other languages. This is a natural-language locale constraint that is not documented as optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt explicitly requires the summary field to be written in Chinese. This is a natural-language locale constraint, and the file does not indicate that users can opt in to Chinese or that the skill is intentionally limited to a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The model request appends Chinese instructions ('请只输出严格JSON。') regardless of user preference. Even though this is brief, it still reflects a forced language choice in natural-language content embedded in the code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The configuration comments indicate the model setup prefers ~/.codex/auth.json and ~/.codex/config.toml, which are likely to contain credentials or sensitive settings. There is no user-facing warning, prompt, or surrounding documentation in this file explaining that local auth files may be accessed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code performs a filesystem write by creating the config directory and overwriting the config JSON file, but there is no prompt, log message, comment, or docstring disclosing that behavior here. Because writing user configuration affects local state, the operation should be clearly disclosed unless that warning exists elsewhere in the skill documentation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.