T09 · Insecure Skill Coding Practices
- Location
scripts/shared/storage/keys.js:47- Finding
Private Keys Stored in Plaintext Without Enforced Restrictive Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is broadly an identity-linking tool, but it handles long-lived identity private keys and verification flows with enough unsafe defaults to require review before installation.
Review before installing. Set BILLIONS_NETWORK_MASTER_KMS_KEY before creating or importing identities, avoid passing real private keys on the command line, restrict access to $HOME/.openclaw/billions, and treat this skill's verification as sensitive because signed challenges and stored keys can prove control of an identity. Also review the network endpoints and update or audit dependencies before using it in a high-trust environment.
scripts/shared/storage/keys.js:47Private Keys Stored in Plaintext Without Enforced Restrictive Permissions
scripts/verifySignature.js:17Authentication Challenges Can Be Replayed Indefinitely
scripts/createNewEthereumIdentity.js:24Private Key Import Through Command-Line Arguments Exposes Secrets
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `identities.json` | Identity metadata |
| `defaultDid.json` | Active DID and associated public key |
| `challenges.json` | Per-DID challenge history |
| `credentials.json` | Verifiable credentials |
There are several ways of storing private keys, to enable master key encryption as described in the **KMS Encryption** section below.
The documented behavior makes strong claims about Billions, ERC-8004, attestation registries, and iden3-based proof workflows, but the visible skill content mainly describes local scripts and file storage without evidence of those security-critical verification flows. A mismatch between stated security properties and actual behavior can cause operators to trust identity linking or proof generation that may not really occur, leading to authentication bypass or false assurance.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
Lets AI agents create and manage their own identities on the Billions Network, and link those identities to a human owner.
cd scripts && npm inst
The skill documents storage of verifiable credentials and related identity artifacts in a predictable directory, which concentrates sensitive material in one location. Even though merely naming credentials.json is not exploit code by itself, in this context it increases the risk of credential harvesting by other tools, plugins, or local users if filesystem protections are weak.
- `kms.json` - **CRITICAL**: Contains private keys (encrypted if BILLIONS_NETWORK_MASTER_KMS_KEY is set, otherwise in plaintext)
- `defaultDid.json` - DID identifiers and public keys
- `challenges.json` - Authentication challenges history
- `credentials.json` - Verifiable credentials
- `identities.json` - Identity metadata
- `profiles.json` - Profile data
ws 8.18.0 is flagged for memory disclosure and fragmentation-based memory exhaustion DoS, both of which are meaningful for software that accepts WebSocket connections or processes hostile WebSocket peers. Given this identity-oriented agent stack includes networking and blockchain tooling, a vulnerable WebSocket implementation in the dependency tree increases risk if any exposed service or upstream connection uses it.
brace-expansion 2.0.2 has multiple denial-of-service issues involving pathological expansion patterns that can hang or exhaust memory. In this lockfile it appears as a transitive, likely build/tooling-oriented dependency, so the underlying issue is real but probably less dangerous unless runtime code accepts attacker-controlled glob or brace patterns.
fast-uri 3.1.0 is flagged for multiple host-confusion and SSRF-related parsing flaws, which are significant wherever untrusted URLs are validated or normalized before outbound requests. This matters more in this skill because identity/attestation flows often fetch remote schemas, DID documents, or verifier resources, making malformed URL handling more security-relevant than in a purely local package.
ws 7.5.10 is vulnerable to memory exhaustion DoS from fragmented frames/data chunks, which can let a hostile peer consume excessive resources. Since this package tree includes RPC/WebSocket infrastructure, the issue is meaningful if any service or client session can be influenced by an attacker-controlled endpoint.
underscore 1.13.6 has uncontrolled recursion risks in _.flatten and _.isEqual that can cause denial of service with crafted deeply nested data. This is a real issue, though likely transitive and only dangerous if exposed to attacker-controlled structured input at runtime.
undici 5.29.0 is flagged for numerous HTTP parsing/smuggling/poisoning issues, which are high-value vulnerabilities in any component making or proxying HTTP requests. This is especially relevant in an identity-verification skill that may contact remote registries, schema endpoints, DID resolvers, or attestation services, where malformed upstream traffic could be weaponized.
ws 8.17.1 is affected by both memory disclosure and memory exhaustion DoS issues, making it a substantive network-facing dependency risk. In this package set, multiple blockchain/RPC libraries rely on WebSockets, so the skill context makes this more dangerous than a purely offline tool because remote peers may influence connection behavior.
The module persists credential data to a predictable local file (credentials.json), which can expose sensitive identity artifacts if the host is multi-user, backups are accessible, or the file store lacks encryption and strict permissions. In an agent identity skill, stored credentials may enable profiling, correlation, or unauthorized reuse depending on what the credential wallet writes.
function newDataStorage(ethStateStorage) {
return {
credential: new CredentialStorage(
new IdentitiesFileStorage("credentials.json"),
),
identity: new IdentityStorage(
new IdentitiesFileStorage("identities.json"),
When no master key is present, _encodeEntry stores private keys in plaintext on disk under provider: "plain", with no hard failure or explicit safeguard. For a decentralized identity skill handling authentication proofs and identity-linked keys, plaintext local storage creates a straightforward compromise path via filesystem access, backups, logs, container escapes, or accidental inclusion in source/control artifacts.
The README instructs users to run npx clawhub@latest install verified-agent-identity, which fetches and executes the latest remote package version at install time rather than a fixed, reviewed version. This creates a supply-chain risk: if the package or its distribution channel is compromised, users may execute attacker-controlled code during installation.
The human installation instructions also use npx clawhub@latest, causing arbitrary current package code to be executed from the registry. Because this skill manages identity material and can lead users to generate or link credentials, a compromised installer could have meaningful security consequences.
The skill declares executable behavior that relies on Node, environment configuration, local sensitive storage, and likely network interaction, but it does not declare any explicit tool scope or permissions. This creates an authorization gap where an agent may be induced to access env variables or make networked identity operations without clear sandboxing or least-privilege controls.
The skill explicitly states that private keys in kms.json may be stored in plaintext when BILLIONS_NETWORK_MASTER_KMS_KEY is unset, but it does not prominently warn users before identity creation or treat encryption as mandatory. This exposes long-lived identity secrets to local compromise, backup leakage, or accidental disclosure, which can allow full impersonation of the agent identity.
This code sends the full authorization request payload to an external URL shortener service, which exposes identity-verification metadata and challenge contents to a third party outside the trust boundary. In an identity-linking skill, that data can reveal sensitive verification context, correlate users and agents, or allow logging and replay analysis by the shortener operator or anyone with access to its records.
The code initializes KeysFileStorage("kms.json"), which indicates private key material is persisted to disk. While there are code comments, they describe component setup rather than warning that sensitive cryptographic material and related identity artifacts will be written locally, so this file lacks a clear user disclosure for a safety-sensitive operation.
The credential and identity storage setup uses file-backed stores for credentials.json, identities.json, and profiles.json, which implies persistent writes of potentially sensitive user data. The file contains no user-facing log, warning comment, or other disclosure explaining that these records are stored on disk.
The file configures connections to rpc-mainnet.billions.network and rhs-staging.polygonid.me, which are external services and may receive wallet, credential-status, or related metadata during operation. Although comments describe configuration, there is no explicit warning that the skill performs outbound network requests to third-party endpoints.
The list() method returns every alias together with its raw privateKeyHex, which unnecessarily broadens access to secret key material beyond simple key discovery or metadata enumeration. In an identity/attestation skill, exposing all private keys through a bulk listing API increases the blast radius of any misuse, logging, or downstream bug and can directly enable impersonation of agent or human-linked identities.
This script signs an arbitrary caller-supplied challenge and emits a valid authentication token without any explicit user confirmation, policy check, or origin validation. In an identity/authentication skill, silent signing is dangerous because any process able to invoke the script can obtain proofs tied to the agent's DID, enabling unauthorized authentication, replay into trusting systems, or abuse of the agent's linked human identity context.
The lockfile pins uuid 13.0.0, and the cited issue affects v3/v5/v6 generation when a caller supplies a destination buffer that is too small. This is a real dependency risk, but its exploitability depends on application code invoking the affected APIs with attacker-influenced parameters; in a lockfile alone we cannot prove a reachable path.
uuid 9.0.1 carries the same missing bounds-check issue for specific UUID generation variants when a buf parameter is used. This is a real package vulnerability, though likely low severity unless the skill's code exposes attacker-controlled buffer usage through reachable API paths.