Back to skill

Security audit

Teeho · 题火小红书笔记诊断

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its note-analysis purpose, but anonymous reports are automatically copied into a machine-wide public history that can expose report contents and local media paths to other local users.

Install only if you are comfortable uploading selected notes and media to Teeho and with anonymous-mode reports plus original media paths being readable by other local OS users. On shared machines, prefer a formal account, avoid anonymous history, and clear history only after understanding what it removes.

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
tools/teeho_skill/diagnosis.py:119
Finding

Automatic cross-user disclosure of anonymous reports and local material paths

Content
View full analysis

Vulnerability Details

File Location: tools/teeho_skill/diagnosis.py:119-123, tools/teeho_skill/public_history.py:42-79, tools/teeho_skill/history.py:107-110, and SKILL.md:199
Vulnerability Type: Plaintext sensitive-data exposure through shared storage
Risk Level: High

Complete Code Snippet

tools/teeho_skill/diagnosis.py:119-123:

python
try:
    HistoryTools(self.root, scope.user_id).save(task, media=local_media(state))
    if scope.anonymous:
        publish_report(HistoryTools(self.root, scope.user_id).read(task["id"]), scope.user_id)

tools/teeho_skill/history.py:107-110:

python
write_json(path, {
    "task": task, "cover": None, "localMedia": locations, "savedAt": saved_at,
})

tools/teeho_skill/public_history.py:42-79:

python
else:
    directory.chmod(0o1777)


def publish_report(report: dict[str, Any], owner: str) -> None:
    """原子发布明文匿名报告;其他用户可读,不能覆写已有报告。"""
    task_id = _identifier(report.get("task", {}).get("id"))
    validated = _report(report, task_id)
    value = {**validated, "anonymousOwner": _identifier(owner)}
    data = json.dumps(value, ensure_ascii=False, allow_nan=False).encode("utf-8")
    if len(data) > MAX_JSON_BYTES:
        raise TeehoError("invalid_local_data")
    directory = _checked_directory()
    _prepare_directory(directory)
    target = directory / (task_id + ".json")
    if target.exists() or is_link(target):
        read_public_report(task_id)
        return
    descriptor, temporary = tempfile.mkstemp(dir=directory, suffix=".tmp")
    temporary_path = Path(temporary)
    try:
        with os.fdopen(descriptor, "wb") as stream:
            stream.write(data)
            stream.flush()
            os.fsync(stream.fileno())
        if os.name == "nt":
            _windows_dacl(temporary_path, f"D:P(A;;FA;;;{_windows_user_sid()})(A;;GR;;;WD)")
        else:
            temporary_path.c
...[truncated 2675 chars]
Remediation
View remediation

Remediation Suggestions

  1. Keep anonymous reports in the existing private account history by default.
  2. Require explicit, informed user confirmation before exporting each report to machine-wide shared storage.
  3. Clearly enumerate the fields that will be shared before confirmation.
  4. Remove localMedia, anonymousOwner, absolute paths, and other account-specific metadata from any public export.
  5. Construct public exports from a strict field allowlist rather than copying the complete private report.
  6. Use mode 0700 for directories and 0600 for files unless cross-user sharing was explicitly requested.
  7. If sharing is required, export to a user-selected destination and warn that other local users may be able to read it.
  8. Add regression tests verifying that ordinary anonymous diagnosis does not create world-readable files and that public exports contain no local paths.

T09 · Insecure Skill Coding Practices

Warning
Location
tools/teeho_skill/public_history.py:42
Finding

World-writable public history permits unauthenticated report injection and task-ID preemption

Content
View full analysis

Vulnerability Details

File Location: tools/teeho_skill/public_history.py:42-45, tools/teeho_skill/public_history.py:48-79, and tools/teeho_skill/public_history.py:88-130
Vulnerability Type: Unauthenticated shared-state injection
Risk Level: Medium

Complete Code Snippet

tools/teeho_skill/public_history.py:42-45:

python
else:
    directory.chmod(0o1777)

tools/teeho_skill/public_history.py:48-79:

python
def publish_report(report: dict[str, Any], owner: str) -> None:
    """原子发布明文匿名报告;其他用户可读,不能覆写已有报告。"""
    task_id = _identifier(report.get("task", {}).get("id"))
    validated = _report(report, task_id)
    value = {**validated, "anonymousOwner": _identifier(owner)}
    data = json.dumps(value, ensure_ascii=False, allow_nan=False).encode("utf-8")
    if len(data) > MAX_JSON_BYTES:
        raise TeehoError("invalid_local_data")
    directory = _checked_directory()
    _prepare_directory(directory)
    target = directory / (task_id + ".json")
    if target.exists() or is_link(target):
        read_public_report(task_id)
        return
    descriptor, temporary = tempfile.mkstemp(dir=directory, suffix=".tmp")
    temporary_path = Path(temporary)
    try:
        with os.fdopen(descriptor, "wb") as stream:
            stream.write(data)
            stream.flush()
            os.fsync(stream.fileno())
        if os.name == "nt":
            _windows_dacl(temporary_path, f"D:P(A;;FA;;;{_windows_user_sid()})(A;;GR;;;WD)")
        else:
            temporary_path.chmod(0o644)
        try:
            os.link(temporary_path, target)
        except FileExistsError:
            read_public_report(task_id)
    finally:
        temporary_path.unlink(missing_ok=True)

tools/teeho_skill/public_history.py:88-102:

python
def public_reports() -> list[dict[str, Any]]:
    directory = _checked_directory()
    if not directory.exists():

...[truncated 3817 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not treat a world-writable directory as an authoritative report database.
  2. Store authoritative reports in private per-user directories and expose only explicitly exported, non-authoritative copies through shared storage.
  3. Authenticate shared reports with a keyed MAC or digital signature covering the complete canonical report and task ID.
  4. Verify the signature before a report is listed, merged, or returned by visible_report.
  5. Separate writable producer directories by user and expose a read-only aggregated view where required.
  6. Bind each report to an authenticated owner and verify that binding rather than trusting the embedded anonymousOwner value.
  7. On publication, treat an existing target created by an untrusted owner as a conflict; do not silently accept it as the legitimate report.
  8. Add tests in which a second local user creates a structurally valid report and confirm that it is rejected from history and cannot preempt legitimate publication.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (86)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Even if some backend analysis exists, the visible skill content clearly exposes undeclared local filesystem, permission-sensitive, and stateful behaviors beyond the marketed purpose. That mismatch is dangerous because it encourages granting broad access to a tool whose true data-handling and execution surface is much wider than advertised.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
tools/teeho_skill/constants.py:27