Back to skill

Security audit

AI 速记敏捷助手

Security checks for vulnerabilities and agentic risk

Overview

SnapNotes appears to be a legitimate note helper, but its AI features can expose business notes, passwords, and API keys too broadly.

Review before installing. Do not store passwords, API keys, tokens, customer secrets, or confidential deal details in this tool. Use only a trusted HTTPS AI endpoint with a limited key, and assume search or analysis may transmit stored notes to that provider.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/manage_notes.py:22
Finding

Unrestricted API Endpoint Can Receive Credentials and Sensitive Note Data

Content
View full analysis

Vulnerability Details

File Location: scripts/manage_notes.py:22-35
Additional Affected Locations: scripts/manage_notes.py:42-55, scripts/manage_notes.py:85-103, scripts/manage_notes.py:107-119
Vulnerability Type: Unvalidated external endpoint and insecure transmission of sensitive data
Risk Level: High

Vulnerable Code

python
def call_ai(prompt, config):
    if not config or not config.get("api_key"): return None
    headers = {"Authorization": f"Bearer {config['api_key']}", "Content-Type": "application/json"}
    payload = {
        "model": config.get("model", "google/gemini-3.1-pro-preview"),
        "messages": [{"role": "user", "content": prompt}],
        "temperature": 0.1
    }
    try:
        response = requests.post(f"{config['api_base'].rstrip('/')}/chat/completions", headers=headers, json=payload, timeout=60)
        return response.json()['choices'][0]['message']['content'].strip()
    except Exception as e:
        print(f"⚠️ AI error: {e}")
        return None

Technical Analysis

The api_base value is loaded from configuration and interpolated directly into the request URL without validating the URL scheme, destination host, resolved IP address, or trust status. The request includes the configured API key in an Authorization: Bearer header and includes the supplied prompt in the request body.

Consequently, an http:// endpoint can expose credentials and note contents over an unencrypted connection. An attacker-controlled HTTPS endpoint would still receive both the credential and the submitted business data. Depending on the command used:

  • add submits the new note for entity and quality analysis.
  • analyze submits collected note contents for report generation.
  • search places the complete loaded note collection into the AI prompt, rather than first restricting the request to locally selected candidates.

Because arbitrary destinati ...[truncated 1893 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require https:// for remote API endpoints and reject plaintext HTTP.
  2. Parse the endpoint with a standard URL parser and reject malformed URLs, embedded credentials, unexpected schemes, fragments, and suspicious redirects.
  3. Maintain an allowlist of approved API hosts or require explicit, prominent confirmation before trusting a custom provider.
  4. Resolve the destination and reject loopback, link-local, multicast, and private-network addresses unless private endpoints are an explicitly enabled feature.
  5. Disable automatic redirects or revalidate every redirect destination before forwarding the authorization header.
  6. Display a clear disclosure identifying which provider will receive note data.
  7. Redact likely secrets, passwords, tokens, and other sensitive fields before creating AI prompts.
  8. For search, perform local keyword or embedding-based candidate selection first and submit only the minimum required records.
  9. Use provider-specific credentials with minimal permissions, spending limits, and straightforward rotation.
  10. Update the privacy documentation because transport encryption is not guaranteed by the current implementation.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/manage_notes.py:8
Finding

API Credential Is Stored in a Plaintext Configuration File Without Enforced Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/manage_notes.py:8-19
Related Documentation: README.md:39-49
Vulnerability Type: Insecure storage of an API credential
Risk Level: Medium

Vulnerable Code

python
# Path configuration
home = Path.home()
BASE_DIR = home / ".openclaw" / "workspace" / "memory" / "snapnotes"
BASE_DIR.mkdir(parents=True, exist_ok=True)
CONFIG_PATH = BASE_DIR / "config.json"

def load_config():
    if CONFIG_PATH.exists():
        try:
            with open(CONFIG_PATH, "r") as f:
                return json.load(f)
        except: return None
    return None

The documented configuration structure places the API key directly in CONFIG_PATH:

json
{
  "api_base": "https://example-provider.invalid/v1",
  "api_key": "sk-private-api-key",
  "model": "selected-model"
}

Technical Analysis

The documented setup instructs users to persist an API key in memory/snapnotes/config.json. The implementation reads that credential as plaintext and does not verify that the file is owned by the current user or restricted to that user.

mkdir(parents=True, exist_ok=True) uses permissions influenced by the process umask and does not enforce mode 0700 on an existing directory. Likewise, no code creates or validates the configuration file with mode 0600. The implementation also does not support an operating-system credential store as the preferred credential source.

This means the confidentiality of the key depends entirely on ambient filesystem permissions and user setup. Systems with permissive umasks, shared workspace access, broadly readable backups, or other local principals may expose the credential.

Attack Path

  1. A user follows the documented setup and writes an API key into memory/snapnotes/config.json.
  2. The containing directory or file has permissions that allow another local principal, shared process, backup service ...[truncated 863 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prefer an operating-system credential manager or secret-management service instead of storing the key in JSON.
  2. Support a protected environment variable for noninteractive deployments.
  3. If file storage remains supported, create the directory with mode 0700 and the configuration file with mode 0600.
  4. Validate file ownership and permissions before reading the key; refuse to proceed when the file is group-readable or world-readable.
  5. Avoid following symbolic links when creating or opening credential files.
  6. Separate non-sensitive settings such as the model and endpoint from the secret credential.
  7. Warn users not to commit, synchronize, or include the credential file in broadly accessible backups.
  8. Recommend provider-side least privilege, spending limits, expiration, and immediate key rotation after suspected disclosure.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example shows semantic retrieval directly returning a previously stored password in plaintext, which encourages users to expose sensitive credentials through conversational queries. In the context of an AI-powered business memory tool with structured storage and recall, this is especially dangerous because the product positioning makes it likely users will centralize sensitive operational data, amplifying the blast radius of unauthorized access or prompt-driven disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly demonstrates storing and later retrieving a website password through natural-language search, normalizing the use of the tool as a credential store without any warning or masking. In a note-taking skill focused on fast capture and semantic recall, this materially increases the chance that users place secrets into searchable notes and that those secrets are later exposed in plaintext to anyone with access to the tool or its outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The configuration instructions tell users to place a private API key in a local JSON config file but provide no warnings about file permissions, secret management, accidental commits, or reuse of production credentials. While common in setup docs, omitting credential-handling guidance can lead to key leakage through source control, shared workspaces, backups, or local compromise.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises executable commands and appears to rely on file read, file write, and potentially network-capable code, but it does not declare any explicit tool scope or permissions boundary. This creates an authorization and transparency gap: a host may grant broader access than users expect, increasing the chance of unintended data access, modification, or exfiltration when handling business notes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language content of this skill, including its description and usage instructions, is entirely in Chinese. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly justified or users are offered a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The add flow sends raw user note content to a third-party AI endpoint for entity extraction and quality analysis, but there is no consent prompt, disclosure, redaction, or local-only default. Because this skill is designed for sales/procurement notes, the content may contain customer names, pricing, order numbers, supplier details, or other confidential business data, creating a real privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The analysis feature aggregates note history and transmits a bulk dataset to the external AI service without a clear warning or user approval. In this business context, sending many days of notes at once materially increases exposure by revealing customer relationships, product focus, pricing trends, and operational priorities, amplifying the impact of any provider-side retention, leakage, or misconfiguration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The search function constructs a prompt containing the user's query plus the full note corpus and sends it externally, even when only a small subset may be relevant. This creates unnecessary over-sharing of potentially sensitive commercial records and allows a simple search action to disclose all stored notes to the configured AI provider.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The prompts sent to the model are written only in Chinese, and several user-facing outputs are also Chinese-specific. This imposes a language choice without offering the user any locale selection or documenting that the tool is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.