T09 · Insecure Skill Coding Practices
- Location
SKILL.md:64- Finding
API Key Disclosure Through Environment Variable Inspection
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 64–66
Vulnerability Type: Sensitive credential exposure through terminal output
Risk Level: MediumVulnerable Code
bash env | grep PRANA_SKILL_API_FLAGTechnical Analysis
The documented workflow checks whether
PRANA_SKILL_API_FLAGexists by printing the matching environment entry. Becauseenvemits both the variable name and its complete value, this command exposes the API key in plaintext.The disclosed value may be captured in agent transcripts, terminal scrollback, command-execution logs, CI output, screen recordings, or diagnostic reports. This behavior is unnecessary because the workflow only needs to determine whether the variable is present; it does not need to read or display its value.
The same document later recommends storing the credential in global configuration. Persistent storage can increase the duration and scope of exposure if the configuration is readable by other local users or included in backups, although the actual storage permissions of
openclaw configare not defined in the audited project.Attack Path
- A user or agent follows Step 1 of the documented workflow.
- The shell executes
env | grep PRANA_SKILL_API_FLAG. - The complete API key is printed to standard output.
- The output is retained in a transcript, terminal log, CI log, diagnostic capture, or other accessible record.
- An unauthorized party obtains the exposed key.
- That party reuses the key as the
x-api-keyheader against the declared Prana endpoints, subject to the permissions and server-side controls associated with that credential.
Impact Assessment
Successful exploitation discloses the Prana API credential available to the current process. An attacker may gain the ability to submit remote agent tasks, query task results, or access other API functionality authorized for that key. The precise privilege scope depends ...[truncated 264 chars]
- Remediation
View remediation
Remediation Suggestions
Replace the value-printing command with a presence-only check:
bash if [ -n "${PRANA_SKILL_API_FLAG:-}" ]; then echo "PRANA_SKILL_API_FLAG is configured" else echo "PRANA_SKILL_API_FLAG is not configured" fiAdditional hardening measures:
- Never print, log, or include the complete API key in chat responses or diagnostic output.
- Prefer runtime secret injection or an operating-system secret manager over plaintext global configuration.
- If persistent storage is required, document and enforce restrictive file permissions and exclude the configuration from backups, telemetry, and support bundles where appropriate.
- Redact the credential from process output and error reports.
- Provide a documented key-revocation and rotation procedure for suspected disclosure.
- Use session-scoped storage by default and require explicit informed consent before persistent storage.
