Back to skill

Security audit

LYGO Forkling

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a local test-agent tool, but its documented self-check can delete existing local state without explicit consent and its install command uses a mutable external installer.

Review this before installing if you have existing lygo-forkling state: running scripts/self_check.py can erase the local state/ directory. Prefer a pinned installer version or verify the installer provenance before using the npx command, and back up any existing state before running the self-check.

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/self_check.py:13
Finding

Self-Check Recursively Deletes Existing Application State Without Explicit Consent

Content
View full analysis

Vulnerability Details

File Location: scripts/self_check.py, lines 13-16
Vulnerability Type: Destructive filesystem operation without explicit consent or state isolation
Risk Level: Medium

Vulnerable Code:

python
def main() -> int:
    if f.STATE.exists():
        shutil.rmtree(f.STATE)
    checks = {"signature": f.SIG, "birth": False, "loop": False, "propose_dry": False, "ok": False}

The documented installation procedure directs users to execute the affected script:

bash
npx clawhub@latest install deepseekoracle/lygo-forkling
cd path/to/lygo-forkling
python scripts/self_check.py

Technical Analysis

The self-check uses shutil.rmtree() to recursively and irreversibly remove the complete application state directory whenever it exists. It does not request confirmation, require the documented --i-consent option, create a backup, or isolate tests in a temporary directory.

The removed directory can contain the fork identity, fitness information, ledger records, and generation snapshots. The self-check then calls the normal birth and loop functions, replacing the deleted state with test-generated data. Consequently, successful completion may conceal the fact that pre-existing data was destroyed.

This behavior conflicts with the documented security boundary that writes to state/ require explicit consent. Although the path is derived from the installed project location rather than direct attacker input, the unsafe lifecycle design creates a reliable local data-loss condition.

Attack Path

  1. A user has an existing state/ directory containing prior Forkling state and generation history.
  2. The user follows the documented installation, update, or verification procedure and runs python scripts/self_check.py.
  3. The script detects the existing directory and passes it to shutil.rmtree().
  4. All files and subdirectories under state/ are recursively deleted without ...[truncated 640 chars]
Remediation
View remediation

Remediation Suggestions

  • Run self-check operations inside a newly created temporary directory, such as one managed by tempfile.TemporaryDirectory().
  • Refactor state paths so tests can inject an isolated state root rather than using the production f.STATE constant.
  • Never recursively delete the operational state directory as part of a normal self-check.
  • If a reset feature is required, expose it as a separate command with an explicit option such as --reset-state --i-consent.
  • Display the exact directory that will be removed and require interactive confirmation unless a separately documented non-interactive override is provided.
  • Create a verified backup before destructive operations and restore it if the self-check fails.
  • Add a regression test that creates sentinel data in the operational state directory, runs the self-check, and verifies that the sentinel remains unchanged.
  • Update the documentation to distinguish non-destructive verification from explicitly authorized state-reset operations.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:46
Finding

Installation Instructions Execute an Unpinned Mutable Registry Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 46-52
Vulnerability Type: Unpinned third-party package execution and supply-chain exposure
Risk Level: Medium

Vulnerable Code:

markdown
## Install

```bash
npx clawhub@latest install deepseekoracle/lygo-forkling
cd path/to/lygo-forkling
python scripts/self_check.py
text

### Technical Analysis

The installation procedure invokes `npx` with the mutable `clawhub@latest` version selector. If the package is not already available locally, `npx` can retrieve and execute package code from the configured registry. The `latest` tag is controlled externally and may resolve to different code over time.

No exact version, integrity digest, lockfile, signature, or provenance verification is specified. Therefore, the package actually executed during installation is outside the immutable scope of the audited project and can change after this review.

This is a supply-chain weakness rather than evidence that the currently reviewed project contains a malicious dependency. Exploitation requires compromise or malicious control of the relevant package, publishing account, registry resolution path, or configured package source.

### Attack Path

1. An attacker compromises the `clawhub` package publishing account, the package registry, or another component capable of controlling the package resolved by `clawhub@latest`.
2. The attacker publishes a malicious release and causes the mutable `latest` tag to reference it.
3. A user follows the project's documented installation instructions.
4. `npx` downloads and executes the attacker-controlled package under the user's account.
5. The malicious package can perform operations permitted to that user before or while installing the reviewed Skill.

### Impact Assessment

Successfully substituted package code executes with the privileges of the user running `npx`. Depending on that account's permissions and environ
...[truncated 502 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace clawhub@latest with an exact, reviewed version, for example clawhub@X.Y.Z.
  • Publish and document a cryptographic checksum or verifiable signature for the expected installer artifact.
  • Use package-manager integrity metadata and a committed lockfile where applicable.
  • Prefer a verification-first installation flow that downloads the artifact without executing it, validates its digest and provenance, and only then runs the installer.
  • Document the expected package source and advise users to verify their registry configuration before installation.
  • Avoid recommending elevated privileges for installation.
  • Establish a controlled dependency-update process in which new installer versions are reviewed and tested before the pinned version is changed.
  • Consider providing a non-npx installation method based on a versioned, signed release artifact.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx clawhub@latest install ... executes the latest published package version at install time, which creates a supply-chain risk if the package is compromised or a breaking/malicious release is published. In a skill explicitly designed to bootstrap autonomous local agent behavior, unpinned installer execution increases risk because users are encouraged to run the command directly from the documentation.

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.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE (reported line 12)May include surrounding context.

text
permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT.

ClawHub distribution uses MIT-0. Lattice policy in references/SECURITY.md is not waived.