T09 · Insecure Skill Coding Practices
- Location
SKILL.md:68- Finding
Gateway Authentication Token Exposed During Triage
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:68
Vulnerability Type: Authentication token disclosure through command output
Risk Level: HighComplete Vulnerable Code Snippet:
bash # 11. Check OPENCLAW_GATEWAY_TOKEN env var (multi-profile foot-gun) echo "OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN:-unset}"Technical Analysis
The triage command expands and prints the complete value of
OPENCLAW_GATEWAY_TOKEN. Because Skill command output can be displayed in a terminal, recorded in an agent transcript, or retained by execution and observability systems, this unnecessarily exposes a reusable authentication credential.Diagnosis only requires determining whether the environment variable is configured. Printing its value violates secret-handling and least-disclosure principles. The token is not hardcoded in the Skill, but it is disclosed at runtime whenever this triage step is executed.
Attack Path
- A user or agent invokes the gateway triage protocol while
OPENCLAW_GATEWAY_TOKENis set. - Shell expansion substitutes the active gateway token into the command output.
- The complete token is captured in terminal history, agent transcripts, diagnostic records, or monitoring logs.
- An attacker with access to one of those output channels retrieves the token.
- The attacker presents the token to a reachable OpenClaw gateway.
- If no additional control blocks the request, the attacker gains the gateway access associated with that token.
Impact Assessment
Successful exploitation can expose the authentication authority assigned to the gateway token. The precise reachable scope depends on gateway network exposure and server-side authorization, but it may include unauthorized gateway connections and access to operations available to an authenticated client. Exposure can also affect multiple profiles if they share the same profile-agnostic environment token.
- A user or agent invokes the gateway triage protocol while
- Remediation
View remediation
Remediation Suggestions
Never print the token value. Test only whether the variable is present:
bash if [ -n "${OPENCLAW_GATEWAY_TOKEN:-}" ]; then echo "OPENCLAW_GATEWAY_TOKEN=set" else echo "OPENCLAW_GATEWAY_TOKEN=unset" fiIf profile comparison is necessary, use a non-reversible, narrowly scoped fingerprint and avoid retaining it in logs. Redact existing transcripts and diagnostic records that may contain the token, rotate any token that may already have been exposed, and ensure command tracing such as
set -xis disabled around secret-handling operations.
