Back to skill

Security audit

Synapse Code

Security checks for vulnerabilities and agentic risk

Overview

This is a broad automation skill that is mostly disclosed, but it installs mutable npm code and writes persistent project memory with insufficient path validation.

Review before installing. Use --dry-run and consider --skip-npm, inspect config.json before running workflows, only use trusted pipeline_summary.json files, and avoid running cleanup commands blindly. This review found material risk and overbreadth, but not artifact-backed exfiltration, deception, or destructive behavior that would justify a malicious verdict.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/auto_log.py:64
Finding

Unvalidated Pipeline Summary Fields Permit Filesystem Path Traversal and Persistent Memory Poisoning

Content
View full analysis

Vulnerability Details

File Location: scripts/auto_log.py:64-91
Vulnerability Type: Path traversal through untrusted path components
Risk Level: High

Vulnerable Code

python
def write_memory_record(project: Path, task: dict) -> Path:
    """写单个 task 的 memory record"""
    task_type = task.get("task_type", "unknown")
    timestamp = task.get("timestamp", datetime.now().isoformat())

    try:
        dt = datetime.fromisoformat(timestamp)
        ts_filename = dt.strftime("%Y-%m-%dT%H-%M-%S")
    except ValueError:
        ts_filename = timestamp[:19].replace(":", "-")

    slug = slugify(task.get("description", "unnamed"))
    filename = f"{ts_filename}-{slug}.md"

    memory_dir = project / ".synapse" / "memory" / task_type
    memory_dir.mkdir(parents=True, exist_ok=True)

    filepath = memory_dir / filename

    qa_line = f"qa_result: {task['qa_result']}" if task.get("qa_result") else ""
    commit_line = f"commit: {task['commit']}" if task.get("commit") else ""

    content = MEMORY_TEMPLATE.format(
        task_type=task_type,
        description=task.get("description", ""),
        outcome=task.get("outcome", "unknown"),
        qa_line=qa_line,
        commit_line=commit_line,
        timestamp=timestamp,
    )

    filepath.write_text(content.strip() + "\n")

Technical Analysis

The task_type value is loaded directly from pipeline-summary JSON and used as a filesystem path component without validation. Python's pathlib path composition does not enforce containment:

  • A task_type containing ../ can traverse outside .synapse/memory.
  • An absolute task_type can cause preceding path components to be discarded, redirecting the write to an arbitrary writable directory.
  • If timestamp parsing fails, the first 19 timestamp characters are used in the filename after replacing only colons. Path separators and traversal sequences are not removed.

...[truncated 2182 chars]

Remediation
View remediation

Remediation Suggestions

  1. Define a strict allowlist of supported task types, such as feature, bugfix, refactor, and documentation.
  2. Reject absolute paths, . and .. components, path separators, null bytes, and unexpected characters.
  3. Sanitize the timestamp through strict date parsing. If parsing fails, generate a server-side timestamp instead of reusing untrusted input.
  4. Resolve and verify the final destination before writing:
    python
    memory_root = (project / ".synapse" / "memory").resolve()
    destination = (memory_root / safe_task_type / safe_filename).resolve()
    
    if memory_root not in destination.parents:
        raise ValueError("Memory destination escapes the allowed root")
    
  5. Open new records using exclusive creation mode where overwriting is not required.
  6. Treat persisted pipeline content as untrusted data. Escape or delimit free-form values and mark their origin so agents do not interpret them as authoritative instructions.
  7. Validate the complete summary against a strict JSON schema, including field types, maximum lengths, allowed task types, and timestamp format.
  8. Add tests covering absolute paths, traversal sequences, malformed timestamps, symlink-based escapes, and instruction-like content.

T08 · Insecure Dependencies

Warning
Location
package.json:9
Finding

Automatically Installed npm Dependency Is Not Reproducibly Pinned

Content
View full analysis

Vulnerability Details

File Location: package.json:9-11
Vulnerability Type: Mutable third-party dependency resolution
Risk Level: Medium

Vulnerable Code

json
"dependencies": {
  "gitnexus": "^1.5.3"
}

The installation path executes dependency installation in install.sh:248-256:

bash
# Install npm dependencies (gitnexus)
if [[ "$SKIP_NPM" == false ]]; then
    if [[ -f "$SKILL_DEST/package.json" ]]; then
        log_step "安装 GitNexus CLI (内建依赖)..."
        cd "$SKILL_DEST"

        if command -v npm &> /dev/null; then
            # Run npm install with error handling
            if npm install 2>&1 | tee /tmp/synapse-npm-install.log; then

Technical Analysis

The Skill automatically runs npm install, but the audited project contains no lockfile and declares gitnexus using the mutable range ^1.5.3. Consequently, installation can resolve a later compatible release and different transitive dependencies than those reviewed with this artifact.

npm installation may execute package lifecycle scripts with the current user's privileges. Therefore, a future compromised package release, compromised transitive dependency, or malicious lifecycle-script update could execute code during Skill installation without any change to this repository.

This finding does not establish that the current gitnexus release is malicious. The vulnerability is the non-reproducible and mutable supply-chain trust boundary.

Attack Path

  1. A user runs install.sh without --skip-npm, or installs the Skill through metadata that requests the npm package.
  2. npm resolves gitnexus and its transitive dependencies using the current registry state rather than a committed reviewed lockfile.
  3. A later package version satisfying ^1.5.3, or one of its transitive dependencies, contains compromised code or a malicious lifecycle script.
  4. npm install downloads the changed c ...[truncated 687 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to an exact reviewed version instead of using a caret range:
    json
    "gitnexus": "1.5.3"
    
  2. Generate, review, and commit package-lock.json.
  3. Replace npm install with npm ci so installation fails if the lockfile and manifest differ.
  4. Review all direct and transitive package lifecycle scripts before release.
  5. Use npm ci --ignore-scripts where lifecycle scripts are unnecessary. If scripts are required, document and constrain them.
  6. Verify registry integrity metadata and use automated dependency monitoring.
  7. Pin the package version consistently in both package.json and the Skill installation metadata.
  8. Consider distributing a reviewed artifact or checksum-verified dependency bundle for security-sensitive installations.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (140)

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

✅ 正确做法

echo "API_KEY=<占位符>" >> config.template.json echo "API_KEY=secret123" >> .env.local echo ".env.local" >> .gitignore

text

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

✅ 正确做法

echo "API_KEY=<占位符>" >> config.template.json echo "API_KEY=secret123" >> .env.local echo ".env.local" >> .gitignore

text

---

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document materially expands the skill from a code-development workflow engine into unrelated domains such as writing, design, analytics, translation, and research. This creates a scope mismatch between the declared skill purpose and actual behavior, increasing the chance that user requests are routed into unintended capabilities and that downstream tools or permissions are used outside the justified trust boundary.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The automatic scenario detection maps broad natural-language requests into non-code task categories that are inconsistent with the stated purpose of the skill. Because the keyword matching is permissive, benign user input can trigger execution paths for unrelated workflows, causing overreach, unexpected processing, and possible misuse of capabilities under a code-oriented trust assumption.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The configuration formally enables multiple non-development agent pipelines despite the skill being described as a code workflow engine. Declaring these pipelines in config makes the scope expansion operational rather than merely illustrative, which can lead to unauthorized or unreviewed execution paths and weakens least-privilege assumptions for the skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document describes broad multi-domain agent coverage while the skill metadata says it is for code development workflows. In an agent ecosystem, overstated capabilities are security-relevant because routing, trust decisions, and user expectations may be based on the declared scope; undocumented expansion raises the risk of prompt-surface growth and execution in contexts that were never reviewed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The release audit claims support for five non-code scenarios that materially expand the skill beyond its declared code-development purpose. This mismatch can mislead users and downstream orchestrators into invoking the skill for broader tasks, increasing the chance of unsafe delegation, over-collection of data, or use of unreviewed agent behaviors outside the advertised scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The capability matrix advertises data collection, analytics, content creation, and design outputs unrelated to the stated code-engineering purpose, including external data sources such as REST APIs and web scraping. Advertising these capabilities without matching scope declarations or domain-specific controls can lead to misuse, data exposure, and invocation of risky workflows under a misleadingly narrow trust label.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the skill's real behavior includes installation, local filesystem modification under ~/.claude/skills, npm-based dependency fetching, and environment validation while presenting itself mainly as a development workflow engine, users may trigger supply-chain and filesystem-changing operations they did not expect. Mislabeling operational/install behavior reduces informed consent and can hide risky steps like package installation and shell execution.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The activation text is very broad, covering generic requests like development, implementing features, running pipelines, recording knowledge, and checking impact scope. Because the skill is user-invocable and documents shell execution, filesystem changes, and automated logging, broad triggers raise the risk of accidental activation on routine requests, leading to unintended code changes or data capture.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest positions the skill as code-development focused, but the documentation expands it into a broad multi-domain workflow engine spanning writing, design, analytics, translation, and research. This scope drift can cause over-triggering on common requests and may route unrelated user data through automation, logging, and external tooling that users did not intend to invoke.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The usage guidance tells users to invoke the skill for writing, design, analytics, translation, and research, even though the metadata frames it as a development skill. In context, this broadens activation across many normal conversations and increases the chance that the skill performs file, shell, pipeline, or logging actions on tasks unrelated to coding.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 99)May include surrounding context.

  1. 检查配置文件:
bash
cat ~/.claude/skills/synapse-code/config.json
  1. 修正路径:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 394)May include surrounding context.

  1. 检查配置文件:
bash
cat ~/.claude/skills/synapse-code/config.json
  1. 修正路径:

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 419)May include surrounding context.

bash
# 清理 Python 缓存
find ~/.claude/skills/synapse-code -name "__pycache__" -exec rm -rf {} \;
find ~/.claude/skills/synapse-code -name "*.pyc" -delete

# 清理临时文件

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 420)May include surrounding context.

bash
# 清理 Python 缓存
find ~/.claude/skills/synapse-code -name "__pycache__" -exec rm -rf {} \;
find ~/.claude/skills/synapse-code -name "*.pyc" -delete

# 清理临时文件

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

Although the static matcher generically flags rm -rf /, the underlying issue here is still the use of forceful recursive deletion syntax in end-user instructions. Even when aimed at a single temp file, embedding this pattern in docs is risky because it can be reused carelessly and conditions users to run high-risk shell commands during support workflows.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 423)May include surrounding context.

find ~/.claude/skills/synapse-code -name "*.pyc" -delete

清理临时文件

rm -rf /tmp/pipeline_summary.json rm -rf /tmp/synapse-*

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
96% confidence
Finding

Although the static matcher generically flags rm -rf /, the underlying issue here is still the use of forceful recursive deletion syntax in end-user instructions. Even when aimed at a single temp file, embedding this pattern in docs is risky because it can be reused carelessly and conditions users to run high-risk shell commands during support workflows.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 423)May include surrounding context.

find ~/.claude/skills/synapse-code -name "*.pyc" -delete

清理临时文件

rm -rf /tmp/pipeline_summary.json rm -rf /tmp/synapse-*

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

This command combines force, recursion, and wildcard path expansion, making it the highest-risk item in the document. In the context of a developer support skill, such commands are especially dangerous because they may be repeated in scripts or executed in environments where /tmp is shared, causing unintended deletion of other data.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 424)May include surrounding context.

清理临时文件

rm -rf /tmp/pipeline_summary.json rm -rf /tmp/synapse-*

text

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

This command combines force, recursion, and wildcard path expansion, making it the highest-risk item in the document. In the context of a developer support skill, such commands are especially dangerous because they may be repeated in scripts or executed in environments where /tmp is shared, causing unintended deletion of other data.

Content

Scanner excerpt · TROUBLESHOOTING.md (reported line 424)May include surrounding context.

清理临时文件

rm -rf /tmp/pipeline_summary.json rm -rf /tmp/synapse-*

text

---