T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/merge_easyclaw_config.py:76
- Finding
- Authentication Tokens Are Disclosed in Migration Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/merge_easyclaw_config.py`, lines 13–20 and 75–78 **Vulnerability Type**: Sensitive information exposure through standard output **Risk Level**: High ### Vulnerable Code ```python MAPPINGS = [ ('commands.native', 'commands.native'), ('commands.nativeSkills', 'commands.nativeSkills'), ('commands.restart', 'commands.restart'), ('gateway.mode', 'gateway.mode'), ('gateway.auth.mode', 'gateway.auth.mode'), ('gateway.auth.token', 'gateway.auth.token'), ] ``` ```python print('Planned changes:') for path, old, new in changes: print(f'- {path}: {old!r} -> {new!r}') ``` ### Technical Analysis The migration list explicitly includes `gateway.auth.token`. When that value differs between the source and target configurations, the script adds the original and replacement values to `changes`. Lines 76–78 then print both values using their raw `repr` representations. No path-sensitive redaction is applied before the values are written to standard output. This behavior affects both dry-run and `--apply` execution. It also conflicts with the sensitive-data handling requirement in `SKILL.md`, which directs the Skill to redact tokens, secrets, and authentication blobs. Although the reporting script contains a redaction function, that protection is not reused by the migration script. ### Attack Path 1. An EasyClaw bridge configuration contains a `gateway.auth.token`. 2. The active OpenClaw configuration either contains a different token or does not contain the field. 3. A user or Agent runs the documented command: ```bash python3 scripts/merge_easyclaw_config.py ``` or: ```bash python3 scripts/merge_easyclaw_config.py --apply ``` 4. The script prints the existing and replacement token values in plaintext. 5. An attacker with access to the terminal transcript, Agent conversation, CI output, centralized logs, or captured process output retrieves the token. 6. If the t ...[truncated 679 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Never print raw values for paths containing sensitive terms such as `token`, `secret`, `password`, `credential`, or authentication keys. 2. For sensitive changes, print only the field name and a neutral status: ```python print(f'- {path}: <redacted> -> <redacted>') ``` 3. Introduce a shared redaction function and apply it to every diagnostic, dry-run, error, and success output path. 4. Prefer an explicit sensitive-path allowlist because field-name substring matching can miss unusually named credentials. 5. Add automated tests verifying that known token values never appear in captured standard output or standard error during dry-run and apply operations. 6. Rotate any gateway tokens that may already have been exposed through prior migration logs. ]]>
