T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:116
- Finding
- Main Authentication Profile Is Duplicated into Tenant Agents<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 116-127 **Vulnerability Type**: Authentication credential sharing across trust boundaries **Risk Level**: High ### Vulnerable Code ```bash MAIN_AUTH="/root/.openclaw-PROFILE/agents/main/agent/auth-profiles.json" AGENT_AUTH_DIR="/root/.openclaw-PROFILE/agents/user-${UID}/agent" mkdir -p "${AGENT_AUTH_DIR}" cp "${MAIN_AUTH}" "${AGENT_AUTH_DIR}/auth-profiles.json" # In entrypoint.sh (after agent re-registration loop): for uid_dir in /workspaces/[0-9]*; do uid=$(basename "$uid_dir") agent_auth_dir="/root/.openclaw-PROFILE/agents/user-${uid}/agent" if [ ! -f "${agent_auth_dir}/auth-profiles.json" ]; then mkdir -p "${agent_auth_dir}" cp "${MAIN_AUTH}" "${agent_auth_dir}/auth-profiles.json" fi done ``` ### Technical Analysis The Skill recommends copying the main agent's authentication profile into every tenant agent directory. This is credential duplication rather than authentication separation. Every tenant consequently receives access to the same authentication material as the main agent. The risk is amplified by the Skill's acknowledgment that filesystem restrictions do not constrain shell commands unless full sandboxing is enabled. A compromised or prompt-injected tenant agent with shell access may therefore read the copied profile. The credentials granted to each tenant are not scoped to that tenant's minimum requirements. Compromise of any one tenant can expose shared credentials and affect every service or account accessible through the main profile. ### Attack Path 1. An attacker sends a prompt-injection payload to a public tenant bot. 2. The tenant agent is induced to invoke an available shell or execution tool. 3. The attacker reads the tenant's copied `auth-profiles.json`. 4. Authentication tokens or provider credentials are extracted from the profile. 5. The attacker reuses those credentials to impersonate the main agent or access associated exte ...[truncated 624 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Never copy the main agent's authentication profile into tenant directories. - Issue a unique, least-privilege credential set for each tenant or agent. - Scope each credential to only the APIs, operations, resources, and quotas required by that tenant. - Store credentials through a secret manager or credential broker rather than ordinary workspace files. - Use short-lived tokens and implement rotation and revocation per tenant. - Apply restrictive ownership and file permissions to any unavoidable local credential files. - Require per-agent or per-session sandboxing so tenant shell processes cannot inspect another agent's files. - Audit for existing duplicated profiles and rotate the main credentials after removing all copies. ]]>
