T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/mint_pack_v2.py:29- Finding
Incorrect Workspace Root Resolution Causes Out-of-Project Filesystem Writes
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly performs local pack hashing and receipt generation, but it needs review because some scripts can write outside the intended workspace, follow symlinks in packs, and run unverified local helper code if invoked.
Review before installing. Run it only on trusted pack folders, avoid elevated privileges, check where state/reference outputs will be written in your environment, and avoid the legacy mint_pack_local.py wrapper unless the external tools it calls are known and pinned. Treat generated ledgers as mutable local records, not independent proof by themselves.
scripts/mint_pack_v2.py:29Incorrect Workspace Root Resolution Causes Out-of-Project Filesystem Writes
scripts/mint_pack_local.py:35Legacy Mint Wrapper Executes Unverified External Python Tools
scripts/bundle_pack_v2.py:35Pack Processing Follows File Symlinks Outside the Selected Directory
scripts/verify_pack_v2.py:30Verifier Cannot Reproduce Hashes Using the Documented Workflow
scripts/backfill_anchors.py:23Anchor Backfill Allows Semantically Invalid Ledger Records
The declared description presents a broad operator suite with multiple core functions: pack canonicalization, hashing, dual-ledger output, anchor snippet generation, and pack verification. The supplied code chunk does not implement those functions. Instead, it is a single-purpose backfill tool that appends an anchor_update entry to state/lygo_mint_ledger.jsonl using CLI-provided values. While append-only ledger behavior is loosely consistent with part of the description, the actual primary purpose is materially narrower and different from the declared suite capabilities. Therefore, the description does not accurately represent this code chunk.
The declared description presents a broad, advanced LYGO-MINT suite with multiple trust/anchoring functions: canonicalization, hashing, ledger production, anchor snippet generation, and verification. The supplied code chunk performs only one narrow task: creating a deterministic-style zip bundle from a directory by sorting files and fixing zip timestamps. While this may support part of a bundling/canonicalization workflow, it does not implement most of the declared capabilities and its primary behavior is substantially narrower than the description.
The declared description presents a broad operator suite with multiple core capabilities: pack canonicalization, hash generation, ledger writing, machine-readable snippet generation, and third-party verification. The supplied code only implements a narrow subset: it parses CLI arguments, optionally reads a canonical ledger JSON file, extracts matching metadata for a provided hash, and prints a portable text anchor snippet template. It does not create or update ledgers, does not compute hashes, does not canonicalize multi-file packs, and does not verify third-party packs. This is a material description-behavior mismatch because the code chunk's actual purpose is much narrower than the declared suite.
The declared description presents a broad 'operator suite' with several substantive capabilities: canonicalizing packs, computing hashes, writing ledgers, generating snippets, and verifying packs. The supplied code only formats and prints an anchor snippet from command-line arguments, with minimal platform-specific handling for Discord code fences. It does not inspect files, compute hashes, canonicalize content, write any ledger files, or verify external packs. While snippet generation is one stated capability and the supported platforms align with the description, the overall declared purpose materially overstates what this code chunk actually does.
The declared description presents a broad 'Advanced LYGO-MINT Operator Suite (v2)' with multiple capabilities: multi-file pack canonicalization, per-file and bundle hashing, canonical and append-only ledgers, machine-readable multi-platform anchor snippets, and third-party verification. The supplied code chunk is much narrower. It accepts a single --pack path, invokes an external mint_pack.py tool, records the returned output into a JSONL ledger, optionally runs canonicalize_ledger.py, and prints a simple text anchor snippet. It does align partially with ledger writing and canonical ledger updating, but the major advertised capabilities are not implemented in this chunk: there is no multi-file orchestration logic, no per-file hash generation, no bundle hash logic, no verification workflow, and no distinct multi-platform snippet generation beyond plain console text. Therefore the code's actual behavior is materially narrower than the declared purpose.
Most of the declared behavior is represented: the code accepts a file or directory, canonicalizes text files, computes per-file hashes and a bundle-level manifest hash, and writes both append-only and canonical ledger artifacts. However, the description materially overstates two capabilities. First, it says the suite can verify third-party packs, but this code only mints/records a pack and contains no verification workflow or validation logic against external packs. Second, it advertises machine-readable multi-platform Anchor Snippets across specific platforms, but the implementation emits one generic newline-delimited snippet embedded in JSON, with no platform-specific formatting for MoltX/Moltbook/X/Discord/4claw. Therefore the description does not accurately match the supplied code chunk.
The declared description presents a broad operator suite with multiple capabilities: pack canonicalization, per-file and bundle hash generation, ledger writing, anchor snippet production, and third-party pack verification. The supplied code chunk only implements the verification portion. It computes hashes and canonicalizes a manifest as part of verification, but does not write ledgers, generate anchor snippets, or expose the broader suite functionality described. Since the described primary purpose is substantially broader than the actual behavior of this code chunk, the description does not accurately represent what this specific supplied code does.
The skill advertises shell, file read, and file write driven workflows but declares no explicit tool scope or permission boundaries. That creates an avoidable trust gap: an agent may be induced to perform filesystem mutations or shell execution without a narrowly defined allowlist, increasing the chance of unintended command execution or writes outside the expected workspace.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_py(path: Path, args: list[str]) -> subprocess.CompletedProcess:
return subprocess.run([sys.executable, str(path), *args], cwd=str(ROOT), capture_output=True, text=True)
def main() -> None:
Suspicious Unicode normalization or mixed-script content
The script appends to and overwrites files under workspace-controlled state/reference directories as part of normal execution, without any confirmation, dry-run mode, or explicit warning to the caller. In an agent-skill context, this is security-relevant because running the skill mutates persistent workspace state and could overwrite ledger/canonical records or create durable artifacts without the operator fully realizing it.
Suspicious Unicode normalization or mixed-script content
No suspicious patterns detected.