T09 · Insecure Skill Coding Practices
- Location
scripts/ledger.py:113- Finding
Unauthenticated Hash Chain Fails to Detect Rewritten or Truncated Audit History
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This local audit-ledger skill is mostly purpose-aligned, but it overstates its tamper-detection guarantees and includes under-documented commands that can export or overwrite ledger data.
Install only if you want a local workspace change ledger and are comfortable with .ledger storing file names, hashes, timestamps, and user messages. Do not rely on it as forensic-grade tamper proofing against someone who can write to the workspace. Review or avoid the protect, restore, and export commands unless you explicitly want ledger replacement or full ledger disclosure.
scripts/ledger.py:113Unauthenticated Hash Chain Fails to Detect Rewritten or Truncated Audit History
The protect flow automatically overwrites the active ledger with a frozen backup via shutil.copy2(clean, cp) after detecting tampering, without interactive confirmation, dry-run mode, or an explicit opt-in flag. In an agent context, this is a destructive state-changing action that can erase the current chain state, destroy forensic context, or let an attacker influence recovery behavior if backup selection is manipulated.
The skill is explicitly user-invocable and documents execution of a local Python script that reads workspace state, writes a tamper-evident ledger, and likely shells through the host runtime, yet it declares no permissions or allowed-tools scope. That creates an authorization gap: an agent platform may expose file, environment, or shell capabilities more broadly than intended, making it harder to enforce least privilege and increasing the chance of unsafe execution in sensitive workspaces.
The export command prints the full workspace path and the entire ledger contents, including file names, timestamps, messages, and snapshots, directly to stdout with no redaction or privacy warning. In agent environments, stdout is often captured by logs, orchestration systems, or upstream tools, so this can unintentionally disclose sensitive repository structure, operational history, and possibly user-provided messages.
No suspicious patterns detected.