T09 · Insecure Skill Coding Practices
- Location
SKILL.md:92- Finding
Overbroad and Executable Environment File Loading
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 92
Vulnerability Type: Unsafe shell evaluation of a credential configuration file
Risk Level: MediumVulnerable Code:
bash source ~/clawd/.envTechnical Analysis
The Skill requires only
COMFY_DEPLOY_API_KEY, but the documented command uses the shellsourcebuilt-in to evaluate the entire~/clawd/.envfile as executable shell code. An.envfile is therefore not treated merely as configuration: command substitutions, shell functions, redirections, and arbitrary commands in that file execute with the invoking user's privileges.This behavior exceeds the minimum privilege required for the declared functionality. The API key should either already be provided through the process environment or be read from a narrowly scoped configuration source without evaluating it. Sourcing the complete file also imports unrelated variables and secrets into the Skill's process environment.
Attack Path
- An attacker, compromised process, or untrusted installer obtains write access to
~/clawd/.env. - The attacker inserts shell commands or command substitutions into the file.
- A user follows the Skill's upload procedure.
- The shell executes
source ~/clawd/.env. - The injected commands run before the legitimate ComfyDeploy requests and inherit the permissions and accessible environment of the Agent user.
Exploitation requires the attacker to gain write access to the referenced environment file or influence its contents. The Skill does not itself grant that access, but it turns a configuration-file compromise into a command-execution path.
Impact Assessment
Successful exploitation permits arbitrary command execution under the account invoking the Skill. The attacker could read or alter files accessible to that account, access environment variables and credentials, make network requests, or tamper with generated outputs. The issue do ...[truncated 404 chars]
- An attacker, compromised process, or untrusted installer obtains write access to
- Remediation
View remediation
Remediation Suggestions
- Remove
source ~/clawd/.envfrom the documented workflow. - Prefer requiring
COMFY_DEPLOY_API_KEYto be supplied through the process environment or a dedicated secret manager. - If file-based configuration is unavoidable, use a parser that treats the file strictly as data and retrieves only the exact
COMFY_DEPLOY_API_KEYfield. Do not usesource,eval, or command substitution. - Store the credential in a dedicated file with restrictive permissions, such as mode
0600, rather than a shared environment file containing unrelated secrets. - Validate that the key exists before issuing requests without printing its value:
bash : "${COMFY_DEPLOY_API_KEY:?COMFY_DEPLOY_API_KEY is required}" - Avoid enabling shell tracing while handling the key, and do not include the authorization header in diagnostic output.
- Document that user-provided images are uploaded to ComfyDeploy so users can make an informed decision before transmitting potentially personal media.
- Remove
