Back to skill

Security audit

agentic-ledger

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent local cost tracker, but it stores full agent conversations locally and asks for broad, persistent host-side control that users should review before installing.

Install only if you are comfortable routing OpenClaw model calls through this local proxy and storing prompts and responses on the machine. Prefer a pinned, verified package version, avoid permanently allowlisting `/usr/bin/curl`, and confirm how to delete or redact ledger data before using it with sensitive work.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Error
Location
SKILL.md:21
Finding
Unpinned Third-Party Package Is Installed and Immediately Executed## Vulnerability Details **File Location**: `SKILL.md`, lines 21-25 **Vulnerability Type**: Unverified and unpinned third-party dependency installation **Risk Level**: High **Vulnerable Code**: ```bash Run these on the host machine (not inside the OpenClaw container): ```bash pip install agentic-ledger agenticledger start agenticledger connect openclaw ``` ``` ### Technical Analysis The setup instructions install `agentic-ledger` without specifying a version, package hash, lockfile, trusted artifact URL, or source verification procedure. The newly installed package is then immediately executed on the host. This dependency operates in a highly sensitive position: it modifies OpenClaw configuration and acts as a proxy for model-provider traffic. According to the Skill documentation, that traffic includes prompts, responses, authorization data forwarded to the provider, token usage, costs, and errors. Consequently, the integrity of the dependency is part of the security boundary. Installing an unpinned package allows the effective code to change after this Skill has been reviewed. A compromised package registry account, malicious future release, dependency-confusion condition, or compromised transitive dependency could cause users to execute attacker-controlled code. ### Attack Path 1. An attacker compromises the package publisher, package distribution channel, or a transitive dependency used by `agentic-ledger`. 2. The attacker publishes a malicious version under the package name selected by the unpinned installation command. 3. A user follows the Skill instructions and runs `pip install agentic-ledger`. 4. The package manager selects the malicious or compromised release. 5. The user executes `agenticledger start` and `agenticledger connect openclaw`. 6. The compromised package executes with the user's host privileges, accesses or changes OpenClaw configuration, and can observe model traffic passing through th ...[truncated 828 chars]
Remediation
## Remediation Suggestions - Pin `agentic-ledger` to a specifically reviewed version rather than installing the newest available release. - Distribute a lockfile containing cryptographic hashes and require hash verification during installation, for example: ```bash pip install --require-hashes -r requirements.lock ``` - Pin and verify all transitive dependencies, not only the top-level package. - Document the canonical package publisher, source repository, release-signing process, and expected package hash. - Prefer a reviewed wheel or other immutable artifact obtained from a trusted release channel. - Run the proxy under a dedicated, minimally privileged operating-system account with access only to required configuration and storage locations. - Restrict outbound network access to the explicitly configured model providers. - Verify updates in a controlled environment before changing the pinned production version.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:47
Finding
Permanent Approval of General-Purpose Curl Breaks Least Privilege## Vulnerability Details **File Location**: `SKILL.md`, lines 47-52 and 88-96 **Vulnerability Type**: Excessively broad command approval **Risk Level**: High **Vulnerable Code at lines 47-52**: ```bash Optional but recommended so cost questions run without an approval prompt each time (this is what the ledger reads need; it pre-approves only curl): ```bash openclaw approvals allowlist add --agent main "/usr/bin/curl" ``` ``` **Repeated Recommendation at lines 88-96**: ```bash When an exec approval prompt appears for one of these reads, ask the user to approve it, and in the same breath tell them the one-liner that stops the asking permanently (it pre-approves only curl, nothing else): ```bash openclaw approvals allowlist add --agent main "/usr/bin/curl" ``` ``` ### Technical Analysis The allowlist rule approves the entire `/usr/bin/curl` executable for the `main` agent rather than approving only the required ledger-report requests. Although the text characterizes this as pre-approving “only curl,” `curl` is a general-purpose network and data-transfer utility. An unrestricted `curl` invocation can contact arbitrary external or internal endpoints, follow redirects, upload local files, send request bodies, attach headers, access Unix sockets where supported, and interact with services that are reachable from the agent environment. Approving the executable therefore grants substantially broader capabilities than the stated requirement of performing fixed, read-only HTTP GET requests against local ledger endpoints. This approval persists beyond the immediate cost-reporting operation. If the agent is later influenced by prompt injection, malicious retrieved content, or another compromised Skill, the pre-approved executable could be used without the interactive authorization boundary that would otherwise warn the user. ### Attack Path 1. The user follows the recommendation and permanently allowlists `/usr/ ...[truncated 1779 chars]
Remediation
## Remediation Suggestions - Do not permanently allowlist a general-purpose network client such as `/usr/bin/curl`. - Create a dedicated ledger-reporting wrapper that: - permits only HTTP `GET`; - permits only `localhost` and `host.docker.internal`; - fixes the allowed port to `8000`; - permits only `/health`, `/api/reports`, `/api/runs`, and `/api/sessions`; - validates query parameters such as `days`; - rejects redirects, proxy configuration, file uploads, arbitrary headers, alternate protocols, and user-controlled URLs; - sets strict connection and response-size limits. - Allowlist only the reviewed wrapper executable rather than `curl`. - Prefer a purpose-built OpenClaw tool with a narrow, typed API and explicit endpoint validation. - Scope approval to a single invocation or current session when narrowly constrained approval is unavailable. - Run the reporting mechanism with minimal filesystem permissions and restricted outbound network access. - Remove existing broad approval entries and require interactive confirmation until a constrained implementation is deployed.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill records prompts and responses locally, but the description does not prominently warn that potentially sensitive conversation content is retained and may later be queried. This creates a privacy and data-handling risk because users may invoke the skill for routine cost questions without realizing that full interaction content is being stored and surfaced through local APIs and the dashboard.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill description is broad enough to trigger on common user requests about cost, usage, and agent activity, which could cause it to activate in many normal conversations. Because this skill instructs the agent to query a local ledger containing prompts, responses, and run history, over-broad activation increases the chance of unnecessary access to sensitive local telemetry.

Static analysis

No suspicious patterns detected.