Back to skill

Security audit

Evernote Yinxiang

Security checks for vulnerabilities and agentic risk

Overview

This skill is a mostly coherent Yinxiang/Evernote note client, but it needs review because it uses a full-access note token from a plaintext file and can delete account notes without built-in confirmation.

Install only if you are comfortable giving this skill a long-lived Yinxiang token that can access your notes. Create the .env file with restrictive permissions, revoke and rotate the token if it may have been exposed, manually confirm note GUIDs before deletion, and be aware the documentation understates the actual Python dependencies.

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/yinxiang.py:43
Finding

Full-Access API Token Stored Without File-Permission Safeguards

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:13-17; scripts/yinxiang.py:43-53
Vulnerability Type: Plaintext credential storage with missing ownership and permission validation
Risk Level: Medium

The setup instructions direct users to store a full-account-access Yinxiang token in a plaintext .env file:

text
YINXIANG_TOKEN=S=your-token

.env file path: ~/.qclaw/skills/evernote-yinxiang/.env

The implementation reads this file without verifying its owner, permissions, file type, or symbolic-link status:

python
@staticmethod
def _load_token():
    env_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), ".env")
    if os.path.exists(env_path):
        with open(env_path) as f:
            for line in f:
                line = line.strip()
                if line and not line.startswith('#') and '=' in line:
                    k, v = line.split('=', 1)
                    if k.strip() == "YINXIANG_TOKEN":
                        return v.strip()
    return os.environ.get("YINXIANG_TOKEN", "")

Technical Analysis

Credential access is necessary for the Skill's declared Yinxiang integration. However, the token grants broad access to the user's account, while neither the instructions nor the implementation enforce least-exposure controls for the credential file.

Files created under a permissive user configuration may be readable by other local users or processes. The loader accepts the file regardless of whether it is group-readable, world-readable, owned by another user, or represented by a symbolic link. Consequently, the confidentiality of the token depends entirely on external filesystem settings that the Skill neither documents nor validates.

Token transmission itself is restricted to fixed Yinxiang production or sandbox hosts over HTTPS in the reviewed implementation. No transmission to unrelated domains was identified.

Attack Pat

...[truncated 1336 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require restrictive permissions when creating the credential file. For example:

    bash
    install -m 600 /dev/null ~/.qclaw/skills/evernote-yinxiang/.env
    
  2. Before reading the file, use os.stat() or os.lstat() to verify that:

    • The file is owned by the current effective user.
    • Group and other permission bits are unset.
    • The path is a regular file.
    • Symbolic links are rejected where supported.
  3. Fail securely with a clear error if the ownership or mode is unsafe rather than silently loading the token.

  4. Prefer an operating-system credential store or secret-management service over a plaintext project-local file.

  5. If a file remains supported, document secure creation, backup, rotation, and revocation procedures.

  6. Use the narrowest token scope supported by Yinxiang. If scoped tokens are unavailable, explicitly warn that compromise exposes the entire account.

  7. Advise users to revoke and replace the token immediately if the .env file may have been exposed. Avoid printing the token in normal output, logs, or exception messages.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

A description-behavior mismatch is a security concern because operators may grant trust based on the stated behavior while the implementation does more than advertised, including undeclared update capability and possible additional dependencies. That gap undermines review, consent, and policy enforcement, especially for a skill that can modify or delete remote user data.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 首次配置

1. 访问 https://app.yinxiang.com/api/DeveloperToken.action 获取开发者 Token(S= 开头)
2. 在技能目录下创建 .env 文件,填入 Token:

YINXIANG_TOKEN=S=你的Token

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## 首次配置

1. 访问 https://app.yinxiang.com/api/DeveloperToken.action 获取开发者 Token(S= 开头)
2. 在技能目录下创建 .env 文件,填入 Token:

YINXIANG_TOKEN=S=你的Token

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/yinxiang.py (reported line 35)May include surrounding context.

python
## 首次配置

1. 访问 https://app.yinxiang.com/api/DeveloperToken.action 获取开发者 Token(S= 开头)
2. 在技能目录下创建 .env 文件,填入 Token:

YINXIANG_TOKEN=S=你的Token

Credential Access

High
Category
Privilege Escalation
Confidence
76% confidence
Finding

The agent guidance explicitly tells the agent to check whether the .env file exists and contains YINXIANG_TOKEN before running commands. In an agent setting, instructing credential inspection increases exposure of secrets to the agent runtime and can normalize reading sensitive local files without an explicit permission boundary.

Content

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

md
## Agent 使用指南

执行任何命令前先检查 Token 是否配置(.env 文件存在且含 YINXIANG_TOKEN)。

创建笔记示例:
python3 ~/.qclaw/skills/evernote-yinxiang/scripts/yinxiang.py create "会议纪要" "今天讨论了项目进度..." --tags "工作,会议"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

python
@staticmethod
    def _load_token():
        env_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), ".env")
        if os.path.exists(env_path):
            with open(env_path) as f:
                for line in f:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares no explicit tool scope or permissions while instructing the agent to access a local .env file and use stored credentials. In an agent environment, missing scope declarations can lead to broader-than-necessary access and makes it harder to enforce least privilege around secret handling.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad everyday terms like 'evernote' and several generic save/search/view phrases, which can cause accidental invocation in unrelated conversations. For a skill that reads, writes, and deletes notes using an account-wide token, unintended activation increases the risk of unauthorized or surprising data operations.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
脚本位置:~/.qclaw/skills/evernote-yinxiang/scripts/yinxiang.py

创建笔记:
python3 scripts/yinxiang.py create "标题" "内容" [--notebook GUID] [--tags tag1,tag2]

搜索笔记:
python3 scripts/yinxiang.py search "关键词" [--max 20]

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
脚本位置:~/.qclaw/skills/evernote-yinxiang/scripts/yinxiang.py

创建笔记:
python3 scripts/yinxiang.py create "标题" "内容" [--notebook GUID] [--tags tag1,tag2]

搜索笔记:
python3 scripts/yinxiang.py search "关键词" [--max 20]

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/yinxiang.py (reported line 32)May include surrounding context.

python
PROD_HOST = "app.yinxiang.com"
    SANDBOX_HOST = "sandbox.yinxiang.com"
    
    def __init__(self, token=None, sandbox=False):
        self.token = token or self._load_token()
        if not self.token:
            raise ValueError("未配置 YINXIANG_TOKEN,请在 .env 文件中设置")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The delete command permanently performs a destructive account action with no confirmation prompt, dry-run mode, or explicit warning at execution time. In an agent skill context, where actions may be triggered from natural-language requests or automation, this increases the chance of accidental or manipulated deletion of user notes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's natural-language interface, including description, CLI help text, and error messages, is entirely in Chinese. There is no indication that the tool is intentionally region-specific or any mechanism for users to select another language, which creates a language-policy concern.

Content

No source excerpt is available for this finding.