Back to skill

Security audit

HeartFlow 心虫 v1

Security checks for vulnerabilities and agentic risk

Overview

This skill claims to be local memory and reasoning only, but it also exposes code execution, network calls, daemon behavior, and persistent prompt memory that need review.

Install only after reviewing whether you are comfortable granting this skill host code execution, local persistence, prompt-level memory injection, optional daemon use, and outbound network capability. Run it in a constrained environment without sensitive credentials, and update or remove the stale vulnerable dependency before production use.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
plugins/heartflow-memory-inject.py:83
Finding

Persistent Untrusted Memory Is Injected into the Agent System Prompt

Content
View full analysis
'); return; } const result = hfm.learn(key, value, ['manual']); if (result.success) { console.log(`Written to LEARNED tier: [${key}] = ${value}`); } } ``` `scripts/heartflow-memory-inject.js:61-119` incorporates stored values directly into the generated prompt text: ```javascript const learnedEntries = Object.entries(hfm.learned) .map(([k, v]) => ({ key: k, ...v })) .filter(e => (e.lastAccessed || 0) >= thirtyDaysAgo) .sort((a, b) => (b.lastAccessed || 0) - (a.lastAccessed || 0)); const conversations = learnedEntries.filter(e => e.tags?.includes('conversation')); const lessons = learnedEntries.filter(e => e.tags?.includes('lesson')); const preferences = learnedEntries.filter(e => e.tags?.includes('preference')); const pains = learnedEntries.filter(e => e.tags?.includes('pain')); const techOps = learnedEntries.filter(e => e.tags?.includes('tech')); const dreams = learnedEntries.filter(e => e.tags?.includes('dream')); if (lessons.length > 0) { lines.push(''); lines.push('Stored lessons:'); for (const e of lessons.slice(0, 10)) { lines.push(` • ${e.value}`); } } if (preferences.length > 0) { lines.push(''); lines.push('User preferences:'); for (const e of preferences) { lines.push(` • ${e.value}`); } } if (conversations.length > 0) { lines.push(''); lines.push('Recent conversations:'); for (const e of conversations.slice( ...[truncated 3055 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/core/code/code-executor.js:440
Finding

Dispatchable Modules Execute Arbitrary JavaScript, Shell, and Python on the Host

Content
View full analysis
context[k]); const fn = new Function( ...contextKeys, `"use strict"; ${code}` ); const result = this._executeWithTimeout(fn, timeout, contextValues); ``` `src/core/code/code-executor.js:546-568` passes supplied shell text directly to Bash after only a regex blacklist check: ```javascript const dangerCheck = checkDangerousCommand(code); if (dangerCheck.dangerous) { return { status: ExecStatus.SANDBOX_BLOCKED, output: '', error: `Blocked command: ${dangerCheck.reason}`, truncated: false, execError: ExecError.SANDBOX }; } const result = execSync(code, { timeout, encoding: 'utf-8', maxBuffer: MAX_OUTPUT_LIMIT, shell: '/bin/bash' }); ``` `src/core/code/code-executor.js:624-638` writes supplied Python to a temporary file and executes it with host privileges: ```javascript fs.writeFileSync(tmpFile, code, 'utf-8'); const pythonCmd = this._getPythonCommand(); const result = execSync(`${pythonCmd} "${tmpFile}"`, { timeout, encoding: 'utf-8', maxBuffer: MAX_OUTPUT_LIMIT }); ``` `src/proactive/self-initiator.js:893-901` exposes another direct Bash execution path: ```javascript const { execSync } = require('child_process'); try { const start = Date.now(); const result = execSync(script, { timeout, shell: '/bin/bash', en ...[truncated 3137 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:26
Finding

Declared Permission Model Contradicts Exposed Network, Filesystem, and Execution Capabilities

Content
View full analysis
{ const timeoutId = setTimeout(() => { req.destroy(); reject(new Error(`Request timeout (${this.TIMEOUT}ms): ${url}`)); }, this.TIMEOUT); const req = https.get(url, { headers: { 'Accept': 'application/json', 'User-Agent': 'HeartFlow/1.0' } }, (res) => { if (res.statusCode === 429 || res.statusCode >= 500) { clearTimeout(timeoutId); req.destroy(); if (retryCount < this.MAX_RETRIES) { const delay = this.BASE_DELAY * Math.pow(2, retryCount); setTimeout(() => { this._get(url, retryCount + 1) .then(resolve) .catch(reject); }, delay); return; } } }); }); } ``` `src/core/openalex-client.js:160-166` constructs an external query using caller-supplied search text: ```javascript const url = `https://api.openalex.org/works?search=${encodeURIComponent(query)}` + `&per_page=${perPage}&page=${page}` + `&select=title,publication_year,cited_by_count,doi,authorships,concepts,type,language`; const result = a ...[truncated 3280 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (728)

Known Vulnerable Dependency: protobufjs==6.11.6 — 11 advisory(ies): CVE-2026-44294 (protobuf.js: Denial of service from crafted field names in generated code); CVE-2026-44293 (protobuf.js: Code injection through bytes field defaults in generated toObject c); CVE-2026-44289 (protobuf.js: Denial of service through unbounded protobuf recursion) +8 more

Critical
Category
Supply Chain
Confidence
98% confidence
Finding

This is a true supply-chain vulnerability finding: package-lock.json pins protobufjs 6.11.6, and the reported advisories include code injection and denial-of-service conditions. Even though this file is only a lockfile, it documents that the skill will install and run the vulnerable package transitively via onnx-proto/onnxruntime-web, so consumers of the skill may inherit exploitable behavior during protobuf parsing or code-generation-related flows.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
99% confidence
Finding

Importing child_process is not by itself the bug, but in this file it is used to execute arbitrary shell and Python subprocesses from untrusted code paths. In the context of an introspective agent skill, that capability is unjustified and dramatically increases risk because any prompt or tool-input reaching this component can become operating-system command execution.

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 · CHANGELOG.md (reported line 314)May include surrounding context.

md
167|#### 修复类别一:描述与行为不匹配
   168|- `package.json`:description 精确匹配 SKILL.md 认知/自愈引擎描述
   169|- `CHANGELOG.md`:标注 MarkCode 为可选独立组件,避免误导
   170|- `skills/video-generate/SKILL.md`:移除"自动写入 API 密钥到 .env"危险指令
   171|- `skills/zai-vision/SKILL.md`:添加安全警告,说明数据外传风险
   172|- `skills/desktop-agent/SKILL.md`:添加高风险警告,默认禁用说明
   173|- `skills/browser-automation/SKILL.md`:添加安全警告,说明网络访问范围

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 · CHANGELOG.md (reported line 329)May include surrounding context.

md
182|- `scripts/awakening-integration.js`:添加安全头部,标注为哲学思考框架
   183|
   184|#### 修复类别三:数据泄露风险
   185|- `plugins/agentmemory/__init__.py`:移除 `_preload_agentmemory_dotenv()`,不再自动读取 .env
   186|- `plugins/agentmemory/__init__.py`:`sync_turn()` 默认禁用,需 `AGENTMEMORY_OBSERVE_ENABLED=1` 才发送数据
   187|- `src/core/autonomy/pdca-engine.js`:`saveTrace()` 截断敏感字段,文件权限 0600
   188|

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

These findings consistently show a severe description-behavior mismatch: the skill is presented as a benign philosophical/cognitive engine, but the codebase appears to include concrete operational features such as file I/O, subprocess execution, IPC/daemon behavior, persistent storage, external downloads, and automation hooks. That mismatch is security-relevant because reviewers, users, and runtime policy systems may grant trust or installation based on deceptive or incomplete metadata, while hidden capabilities materially increase the chance of abuse or unsafe execution.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution, suspicious.env_credential_access (+2 more)

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/core/code-engine.js:68

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/core/code-verifier.js:385

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/core/code/code-executor.js:283

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
src/proactive/self-initiator.js:896

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/core/code-engine.js:1586

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/core/code-verifier.js:366

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/core/code/code-executor.js:472

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/proactive/self-initiator.js:484

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/core/search/hybrid-search.js:51

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
src/core/search/hybrid-search.js:421

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
src/utils/atomic-write.js:139