Back to skill

Security audit

Love Companion - AI恋人陪伴技能包

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed local companion and memory system, but its optional trend feature can let outside web text influence privileged agent instructions.

Review before installing if you plan to enable trend awareness or feed it web content. Keep trend awareness off unless you trust the source pipeline, and be aware that the skill stores relationship memories and profiles locally until you export, delete, or purge them.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/trends/store.py:105
Finding

Untrusted Trend Content Is Injected into the System Prompt Without Instruction Isolation

Content
View full analysis

Vulnerability Details

File Location: scripts/pipeline/runner.py:220-228, scripts/trends/store.py:105-139,164-166,203-225, scripts/pipeline/orchestrator.py:142-149, scripts/pipeline/injector.py:129-137
Vulnerability Type: Indirect prompt injection through externally sourced trend content
Risk Level: Medium

Complete Code Snippets

python
# scripts/pipeline/runner.py:220-232
@register("trends.ingest")
def _task_trends_ingest(payload: Dict[str, Any], ctx: Dict[str, Any]) -> Dict[str, Any]:
    """把抓回来的原文离线提炼成要点入库(原文不进上下文)"""
    from scripts.trends.sources import SourceRouter
    from scripts.trends.store import TrendStore

    source = payload.get("source", "")
    result = TrendStore(ctx["data_dir"]).ingest(
        payload.get("raw", ""), payload.get("topic", ""), source)
    # 抓到了算成功,一条都提炼不出来算这个源挂了(影响下次排程)
    if source:
        SourceRouter(ctx["data_dir"]).mark(source, bool(result.get("added")))
    return result
python
# scripts/trends/store.py:105-142
def digest(raw: str, topic: str = "", max_points: int = 4, point_len: int = 22) -> List[str]:
    """把抓取回来的原始文本提炼成数条短要点

    打分:含主题词 +2;含热度词 +1;长度适中 +1;与已选要点重复的直接丢弃。
    """
    text = strip_html(raw)
    if not text:
        return []

    candidates = [s.strip() for s in re.split(r"[。!?!?\n;;]", text) if 8 <= len(s.strip()) <= 80]
    scored: List[tuple] = []
    for s in candidates:
        score = 0.0
        if topic and topic in s:
            score += 2
        score += sum(1 for w in HEAT_WORDS if w in s)
        if 12 <= len(s) <= 45:
            score += 1
        # 纯链接/纯数字/广告导航直接判负
        if re.match(r"^https?://", s) or s.count("/") > 3:
            score -= 2
        if any(w in s for w in NOISE_WORDS):
            score -= 3
        scored.append((score, s))
    scored.sort(key=lambda kv: -kv[0])

    points: List[str] = []
    for _score, s in scored:
        if s and len(s) > point_len:
            s = s[:point_len].rstrip(",,、 ")
        if not s:
       
...[truncated 5407 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not concatenate externally sourced trend text into the System Prompt. Pass it through a lower-trust data or user-content channel supported by the hosting framework.
  2. Wrap every trend item in an explicit structured representation containing fields such as source, topic, and quoted_content.
  3. Add a non-user-controlled instruction outside the quoted content stating that trend entries are untrusted reference data and that instructions contained within them must never be followed.
  4. Preserve provenance through ingestion and rendering so the model-facing layer can enforce trust-aware handling.
  5. Reject imperative or model-directed phrases during ingestion, including attempts to reference system messages, override instructions, request secrets, invoke tools, or redirect the conversation.
  6. Use strict allowlisted schemas for trend points instead of accepting arbitrary natural-language sentences as privileged context.
  7. Add regression tests with indirect prompt-injection payloads embedded in HTML, titles, trend sentences, and repeated high-scoring topic text.
  8. Consider requiring explicit user approval before newly ingested trend content is made available to the prompt assembly layer.
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 (100)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding aggregates a broad set of undeclared capabilities: trend scraping/processing, image-planning, explainability logs, administrative controls, relation forgetting, export/purge, and offline orchestration. Bundling these operationally powerful subsystems into a 'companion' skill without clear scoping increases the chance of over-privileged deployment and informed-consent failures for both operators and users.

Content

No source excerpt is available for this finding.