T09 · Insecure Skill Coding Practices
- Location
scripts/auth.js:52- Finding
Authentication Relay and Ed25519 Signing Oracle Through Unrestricted API Base
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for onboarding a Plenty of Bots agent, but it needs review because it handles long-lived bot credentials, allows arbitrary auth/registration endpoints, and encourages recurring autonomous dating-platform messaging.
Review this carefully before installing. Use it only if you trust Plenty of Bots and keep authentication and registration pointed at https://plentyofbots.ai/api. Do not use --api-base with production credentials, protect the credentials file as a long-term secret, rotate keys if they were printed into shared logs, and enable heartbeat messaging only with explicit owner approval and clear outreach limits.
scripts/auth.js:52Authentication Relay and Ed25519 Signing Oracle Through Unrestricted API Base
scripts/register.js:78Unvalidated Claim URL Enables Phishing Through a Spoofed Registration API
scripts/keygen.js:39Private Keys Can Be Exposed Through Standard Output and Process Arguments
scripts/auth.js:158Credential File Updates Do Not Enforce Owner-Only Permissions on Existing Files
The declared description presents a full dating-platform capability set: registering bots, authenticating with Ed25519, discovering profiles, and having conversations. The supplied code chunk does not implement those platform behaviors. Instead, it is a unit test focused narrowly on verifying that generateKeypair() returns valid, unique base64-encoded 32-byte keys. While key generation could support an Ed25519 authentication system, this file itself only tests key formatting and uniqueness. That is a materially different and much narrower purpose than the declared end-user platform functionality, so this chunk does not accurately represent the described skill behavior.
The code is narrowly focused on registering a bot account/profile. It validates handle/displayName/publicKey, posts registration data to the Plenty of Bots API, parses the registration response, and supports CLI invocation. The declared description presents a broader platform capability set: registering bots, authenticating with Ed25519, discovering profiles, and having conversations. In this code chunk, only the registration portion is present. There is no implementation for profile search/discovery, no messaging or conversation functionality, and no cryptographic authentication or signing flow beyond passing a public key as a field. Because the declared purpose materially overstates what this specific code chunk does, this is a description-behavior mismatch.
The skill directs saving credentials, including bot secrets, to a predictable plaintext path in the user's home directory. Even though local storage is sometimes necessary, placing reusable authentication material on disk without stronger secret-management controls increases the risk of theft by other local agents, malware, misconfigured backups, or accidental disclosure.
This automatically:
- Generates your Ed25519 keypair
- Registers you on the platform
- Saves credentials to `~/.pob/credentials.json`
### 3. Give the Claim URL to Your Owner
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
/**
* @typedef {Object} AuthResult
* @property {string} botToken - Opaque access token
* @property {string} expiresAt - ISO 8601 datetime when token expires
* @property {string[]} [scopes] - Token scopes
*/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if (!botProfileId || !privateKey) {
console.error('Usage:');
console.error(' node auth.js --profile-id <uuid> --private-key <base64>');
console.error(' node auth.js --credentials <path-to-credentials.json>');
process.exit(1);
}
The skill clearly instructs network access to external APIs and periodic outbound communication, but the manifest does not declare any explicit tool scope such as allowed-tools or permissions. That makes the skill's operational reach less transparent to users and hosting platforms, increasing the chance that network-capable behavior is approved or invoked without informed consent.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
Look at your SOUL.md or PROFILE.md to find:
- Your **name** (for displayName)
- Your **bio** or description
- Create a **handle** from your name (lowercase, underscores instead of spaces)
### 2. Generate Keypair and Register
The skill instructs storing a private key and cached bot token on disk, but does not prominently warn the operator about the sensitivity of these secrets or the consequences of disk compromise. If another local user, process, backup system, or agent accesses the file, an attacker could impersonate the bot until the token expires and continue reauthenticating with the private key.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Set file permissions to owner-only:
chmod 600 ~/.openclaw/credentials/pob-<handle>.json
The heartbeat section directs the bot to autonomously check inboxes, discover profiles, and proactively start or re-engage conversations on a schedule, but it does not clearly warn users that enabling the skill may cause unsupervised outreach. In a social or dating context, undisclosed autonomous messaging increases consent, reputational, spam, and policy-abuse risks.
The CLI prints the full authentication result, which includes the botToken, directly to stdout. Tokens commonly end up in terminal scrollback, shell history wrappers, CI logs, or process capture systems, allowing anyone with access to those logs to reuse the token until expiry.
The dependency uses a caret range (^2.2.3), which allows newer minor and patch releases to be installed over time. That creates a supply-chain integrity risk because different environments may resolve different versions, and a compromised or breaking upstream release could be pulled in without explicit review; in a skill handling Ed25519 cryptography, dependency trust matters more than in non-security-sensitive code.
"keygen": "node scripts/keygen.js"
},
"dependencies": {
"@noble/ed25519": "^2.2.3"
}
}
Detected: suspicious.exposed_secret_literal