T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/lib/basecred.mjs:13- Finding
Centralized OpenClaw Credential File Is Loaded Without Key-Level Isolation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to perform reputation lookups, but it should be reviewed because it reads a shared credential file and does not consistently pin the SDK it installs.
Before installing, consider whether you are comfortable with this skill reading ~/.openclaw/.env and exposing every value in that file to the Node process and its dependencies. Prefer running it with an isolated environment containing only TALENT_API_KEY and NEYNAR_API_KEY, verify that @basecred/sdk resolves to the reviewed version, and do not run the isolation test as an elevated user.
scripts/lib/basecred.mjs:13Centralized OpenClaw Credential File Is Loaded Without Key-Level Isolation
package.json:26Reviewed SDK Version Is Not Consistently Pinned Across Installation Paths
test-isolation.sh:54Predictable Shared Temporary File Allows Symlink-Based File Truncation
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
**Fix:** Added prominent security section at top of SKILL.md with:
- Link to SECURITY.md
- TL;DR of security guarantees
- Clear statement of hardcoded .env path
**Impact:** Users immediately see security posture before using skill.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
During security audit response, the focus was on proving "no directory traversal" by showing a concrete path. The path was documented correctly in SECURITY.md, but the **implementation was overly specific**.
The audit report claimed the script "walks up directories to find .env" — to disprove this, I showed the exact hardcoded path... but made it TOO hardcoded by including the specific username.
---
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
During security audit response, the focus was on proving "no directory traversal" by showing a concrete path. The path was documented correctly in SECURITY.md, but the **implementation was overly specific**.
The audit report claimed the script "walks up directories to find .env" — to disprove this, I showed the exact hardcoded path... but made it TOO hardcoded by including the specific username.
---
The documented purpose is simple reputation lookup, but the observed behavior includes local source inspection, dependency auditing, filesystem access, and script execution unrelated to the advertised end-user function. This mismatch is dangerous because users may authorize a seemingly low-risk reputation skill while it performs broader local inspection and execution with greater privacy and integrity implications.
Referenced artifact was not completely inspected
**This skill uses secure, hardcoded credential loading** — see [SECURITY.md](./SECURITY.md) for full audit details.
Referencing the user's home directory and preparing to load .openclaw/.env establishes credential-access capability in the skill. In agent environments, this is dangerous because a library that can read local secret material may be repurposed or extended to expose credentials, and the access is not tightly limited to only the minimum needed inputs.
import { dirname, join } from 'path';
import { homedir } from 'os';
// Load environment variables from OpenClaw .env (user-agnostic)
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const openclawEnvPath = join(homedir(), '.openclaw', '.env');
The dotenv.config call actively reads the .openclaw/.env file, importing any secrets in that file into process memory for use by this module. That creates real credential exposure risk in a plugin/skill context because the skill now depends on ambient local secrets and can use them for outbound authenticated requests without explicit per-call secret passing.
// Load environment variables from OpenClaw .env (user-agnostic)
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const openclawEnvPath = join(homedir(), '.openclaw', '.env');
dotenv.config({ path: openclawEnvPath });
/**
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
{
"name": "basecred-sdk-skill",
"version": "1.0.1",
"description": "Check human reputation via Ethos Network, Talent Protocol, and Farcaster using the neutral basecred-sdk. Fetches composable reputation data without judgment - raw scores, levels, and signals for identity verification and trust assessment.",
"author": "teeclaw",
"license": "MIT",
"openclaw": {
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.
{
"name": "basecred-sdk-skill",
"version": "1.0.1",
"description": "Check human reputation via Ethos Network, Talent Protocol, and Farcaster using the neutral basecred-sdk. Fetches composable reputation data without judgment - raw scores, levels, and signals for identity verification and trust assessment.",
"author": "teeclaw",
"license": "MIT",
"openclaw": {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Isolation Test - Verify hardcoded .env path behavior
set -e
echo "🧪 basecred-sdk-skill Isolation Test"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Test 1: Verify dynamic .env path resolution
echo "✓ Test 1: Verify dynamic .env path (user-agnostic)"
if grep -q "homedir()" scripts/lib/basecred.mjs && grep -q "join(homedir(), '.openclaw', '.env')" scripts/lib/basecred.mjs; then
echo " ✅ PASS: Uses homedir() for portable path resolution"
else
echo " ❌ FAIL: Not using dynamic home directory resolution"
No suspicious patterns detected.