T09 · Insecure Skill Coding Practices
- Location
scripts/infisical.py:128- Finding
JSON Output Discloses Complete Secret Values Without Explicit Raw-Output Authorization
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it claims by reading Infisical secrets, but it can expose raw credentials too easily and lacks enough handling safeguards for such sensitive data.
Install only if you are comfortable giving an agent access to Infisical secrets. Use a tightly scoped machine identity, restrict it to specific projects/environments/paths, avoid --json and --raw unless absolutely necessary, assume output may be logged, and store or rotate the local client secret carefully.
scripts/infisical.py:128JSON Output Discloses Complete Secret Values Without Explicit Raw-Output Authorization
scripts/infisical.py:81Default Masking Function Fully Reveals Short Secrets
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load INFISICAL_CLIENT_ID and INFISICAL_CLIENT_SECRET from ~/.openclaw/.env."""
env_path = os.path.expanduser("~/.openclaw/.env")
result = {}
if os.path.exists(env_path):
for line in open(env_path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load INFISICAL_CLIENT_ID and INFISICAL_CLIENT_SECRET from ~/.openclaw/.env."""
env_path = os.path.expanduser("~/.openclaw/.env")
result = {}
if os.path.exists(env_path):
for line in open(env_path):
This script authenticates to Infisical and retrieves an access token that is then used to enumerate projects and fetch raw secret values. In an agent-skill context, this materially increases risk because it gives the skill direct credential-access functionality and the ability to expose secrets to stdout, including unmasked output via --raw and full JSON output.
def login(client_id, client_secret):
"""Authenticate and return access token."""
url = "https://app.infisical.com/api/v1/auth/universal-auth/login"
body = json.dumps({"clientId": client_id, "clientSecret": client_secret}).encode()
req = urllib.request.Request(url, data=body, headers={"Content-Type": "application/json"})
The skill explicitly instructs the agent to read environment-backed credentials and call external REST endpoints, but it declares no tool/permission scope to constrain env or network access. In an agent ecosystem, this increases the blast radius by allowing a secret-reading skill to operate without transparent least-privilege boundaries, making accidental or unauthorized secret retrieval more likely.
The skill is designed to fetch API keys and other credentials, yet its documentation provides no warning about the sensitivity of returned values, safe handling expectations, or prohibitions on logging/exposing secrets. In practice, operators or downstream agents may print, persist, or transmit raw secret material, turning normal use into credential disclosure.
The setup directs users to store long-lived machine identity credentials in a local plaintext env file under ~/.openclaw/.env, creating persistent authentication material on disk. If the local environment, backups, or adjacent tooling are compromised, an attacker can reuse those credentials to obtain short-lived access tokens and read secrets across granted projects.
## User Setup
1. Create Machine Identity: Organization → Access Control → Machine Identities.
2. Add Universal Auth to the identity → save Client ID + Client Secret.
3. Grant identity access to each project: Project Settings → Access Control → Identities → add as Member.
4. Store credentials in `~/.openclaw/.env`:
This markdown file documents endpoints that return raw secrets, including an example response containing a secret value, but it does not include any warning about the sensitivity of returned data or safe handling practices. For markdown files, missing warnings about behaviors that could affect privacy or sensitive data handling should be flagged.
The manifest describes a lightweight reader used to fetch API keys or credentials from Infisical, which implies secret retrieval. The code additionally implements project/workspace discovery via the workspace API and exposes it through --list-projects, expanding behavior beyond direct secret fetching.
No suspicious patterns detected.