Back to skill

Security audit

LYGO Haven Star Chart Agent Portal

Security checks for vulnerabilities and agentic risk

Overview

The skill is transparent about its workflow, but it depends on mutable external installers and dynamically executes code from a user-selected stack directory without strong provenance checks.

Review before installing. Use only a trusted lygo-protocol-stack checkout, pin or verify the ClawHub package and required skills where possible, and do not run --i-consent submit or ingest commands unless you intentionally want persistent public chart or feed changes.

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

Warning
Location
scripts/_stack_tools.py:19
Finding

Unverified External Python Modules Are Executed In-Process

Content
View full analysis

Vulnerability Details

File Location: scripts/_stack_paths.py:74-78; scripts/_stack_tools.py:19-30
Vulnerability Type: Inadequate trust validation before dynamic code execution
Risk Level: Medium

Vulnerable Code

python
def _assert_stack(p: Path) -> None:
    missing = [rel for rel in _REQUIRED_FILES if not (p / rel).is_file()]
    if missing:
        raise SystemExit(f"Invalid stack root {p}; missing: {missing}")
python
def load_tool(stack_root: Path, basename: str) -> ModuleType:
    if basename not in ALLOWED_TOOLS:
        raise ValueError(f"Tool not allowlisted: {basename}")
    path = (stack_root / "tools" / basename).resolve()
    expected = (stack_root / "tools" / basename).resolve()
    if path != expected or not path.is_file():
        raise FileNotFoundError(f"Missing stack tool: {basename}")
    spec = importlib.util.spec_from_file_location(f"lygo_hsc_{basename[:-3]}", path)
    if spec is None or spec.loader is None:
        raise ImportError(f"Cannot load {basename}")
    mod = importlib.util.module_from_spec(spec)
    sys.modules[spec.name] = mod
    spec.loader.exec_module(mod)
    return mod

Technical Analysis

LYGO_STACK_ROOT selects the directory from which Python tools are dynamically loaded. Stack validation only confirms that expected filenames exist. It does not authenticate the repository, pin an approved revision, verify file hashes or signatures, inspect ownership and permissions, or reject symbolic links.

The filename allowlist limits which filenames may be selected, but it does not establish that the contents of those files are trustworthy. Moreover, the path and expected variables are constructed and resolved identically, so the equality check provides no independent containment assurance.

Calling spec.loader.exec_module(mod) executes all top-level Python code in the selected module before the expected validation or feed function is invoked. Consequently, claims that Skill scripts ...[truncated 1404 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the supported stack to an exact reviewed commit and publish a signed manifest containing hashes of every importable module.
  2. Before every import, verify the selected module against that manifest using a cryptographically secure digest and fail closed on mismatch.
  3. Verify repository provenance with a trusted signature rather than relying on marker filenames.
  4. Reject symlinks for the stack root, tools directory, and imported files; verify containment using independently calculated canonical paths.
  5. Reject stack trees or modules writable by untrusted users, where the platform exposes reliable ownership and permission information.
  6. Prefer shipping the small validation and feed-verification implementation inside the reviewed Skill package.
  7. If external code must run, isolate it in a restricted process with a minimal environment, read-only filesystem access, no network access, resource limits, and a strict input/output protocol.
  8. Update self_check.py so it verifies integrity without importing or executing stack modules.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:44
Finding

Mandatory Workflow Uses Unpinned Remote Packages and Skills

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:44-55
Vulnerability Type: Unpinned remote dependencies and mutable installation sources
Risk Level: Medium

Vulnerable Code

bash
npx clawhub@latest install deepseekoracle/lygo-haven-star-chart
export LYGO_STACK_ROOT=/absolute/path/to/lygo-protocol-stack
bash
npx clawhub@latest install deepseekoracle/lygo-protocol-stack-operator
npx clawhub@latest install deepseekoracle/lygo-network-builder
npx clawhub@latest install deepseekoracle/lygo-sovereign-super-skill

Technical Analysis

The installation instructions direct users to execute clawhub@latest through npx. The latest tag is mutable and may resolve to code different from the version reviewed during this audit. The three declared mandatory Skills are also installed without exact versions, immutable digests, or signature-verification instructions.

These external components are not present in the audited project and therefore were outside the audit scope. The effective workflow can change after publication without any modification to this repository. This creates a supply-chain trust gap and weakens the reproducibility of the reviewed security posture.

Attack Path

  1. An attacker compromises an upstream package, publisher account, distribution registry, or mutable Skill release.
  2. The attacker publishes altered code under the latest package tag or an unversioned Skill identifier.
  3. A user follows the documented mandatory installation commands.
  4. npx retrieves and executes the changed clawhub package, or that package installs a changed Skill.
  5. The unreviewed dependency executes or becomes part of the agent workflow with the user's available privileges.

Impact Assessment

A compromised installer or dependency could execute code with the invoking user's privileges and access resources available to that user, including project files, environment variables, network connectivity, and agent-accessible tools ...[truncated 308 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace clawhub@latest with an exact reviewed version.
  2. Pin every required Skill to an immutable version and content digest.
  3. Publish signed checksums or a signed lockfile and verify them before installation or execution.
  4. Document the expected publisher identity, repository revision, and verification procedure.
  5. Make auxiliary Skills optional unless they are technically required for the declared functionality.
  6. Require a separate review whenever a pinned dependency version changes.
  7. Prefer an installer mode that downloads artifacts without executing lifecycle code until integrity and provenance checks have completed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

The skill contains unusual Unicode symbols and mixed-script markers such as Δ, Φ, ∇, and ⊗ in security-relevant guidance and attestation language. While this appears branding- or domain-related rather than overtly malicious, mixed Unicode can enable confusable text, reviewer confusion, and policy bypass if identifiers or instructions are copied incorrectly.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill claims constrained capabilities in metadata, but it does not declare an explicit tool permission scope despite containing commands that use environment variables, filesystem access, and shell execution. This mismatch can cause an agent platform or reviewer to underestimate the skill's effective privileges, increasing the chance of unsafe execution in a broader-than-expected context.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Using 'npx clawhub@latest' installs and executes whatever version is current at runtime, which is a supply-chain risk. A compromised upstream package, malicious publish, or breaking release could cause arbitrary code execution during installation or use of the skill.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This line again invokes 'npx clawhub@latest' without version pinning, exposing users to unreviewed upstream changes and possible malicious package substitution. Because this is part of the mandatory installation chain, exploitation could affect every downstream user before any local validation occurs.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This unpinned 'npx clawhub@latest' command introduces the same supply-chain exposure in the verification dependency path. Since the command is presented as a prerequisite, a malicious or compromised release could execute prior to trust checks in the referenced stack.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This installation command also uses 'npx clawhub@latest', making the skill chain dependent on mutable external code. In a security-sensitive agent workflow, mutable bootstrap dependencies materially increase the risk of arbitrary code execution and environment compromise.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · references/SKILLSPECTOR_AUDIT.md (reported line 12)May include surrounding context.

md
| Finding | Mitigation |
|---------|------------|
| subprocess + env taint | Skill scripts use **in-process import** via `_stack_tools.py` **allowlist** only (`haven_star_chart_gate.py`, `haven_star_chart_feed.py`). No `subprocess` in skill scripts. |
| Unrestricted tool access | `LYGO_STACK_ROOT` validated against required marker files; paths with `..` or unsafe chars rejected. Submission JSON must be under stack or cwd. |
| Autonomous live submit | **Dual consent:** `--i-consent` on submit/ingest; humans approve before queue/ledger writes. Agents may **propose**; stewards **commit**. |
| Mandated phrasing | `scan_cue` is a **technical gate token** (see `SCAN_CUE_MARKERS` in stack gate), not personality coercion. Suggested status messages are optional templates. |
| Human excluded | Humans may run **read-only** gate and `--dry-run` submit directly. Portal rejects un-attested browser forms (`human_direct`), not human oversight. |

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/self_check.py (reported line 11)May include surrounding context.

python
from _stack_paths import resolve_stack_root
from _stack_tools import load_tool

ROOT = __import__("pathlib").Path(__file__).resolve().parents[1]

REQ = [
    ROOT / "SKILL.md",

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/_stack_tools.py:30