T09 · Insecure Skill Coding Practices
- Location
scripts/inspect-qqbot.sh:38- Finding
Diagnostic Script Exposes Sensitive Operational and User Data
- Content
View full analysis
Vulnerability Details
File Location:
scripts/inspect-qqbot.sh, lines 8-12, 30-34, and 38-41
Vulnerability Type: Sensitive information exposure through diagnostic output
Risk Level: MediumVulnerable Code
bash echo '== openclaw.service ==' if systemctl status openclaw.service --no-pager --lines=20 2>/dev/null; then : else echo 'systemd status unavailable in current shell environment' fibash print('bindings:') for item in obj.get('bindings', []): print(' ', item) print('accounts:') for key, value in (obj.get('channels', {}).get('qqbot', {}).get('accounts', {}) or {}).items(): print(f' {key}: appId={value.get("appId")} secretFile={value.get("clientSecretFile")}')bash if [ -f "$KNOWN" ]; then echo '== known users ==' cat "$KNOWN" else echo "known-users.json missing: $KNOWN" fiTechnical Analysis
The inspection script prints recent service status output, complete binding objects, QQ application identifiers, credential-file paths, and the entire known-users database. These values are emitted without redaction or filtering.
Although inspecting routing metadata is consistent with the skill's diagnostic purpose, exposing complete records violates data-minimization principles. Service logs and binding objects may contain additional sensitive values depending on the local deployment. The known-users file may disclose QQ user identifiers and account relationships.
The
QQBOT_KNOWN_USERSenvironment variable also controls which file is displayed. A caller that can influence this environment variable can direct the script to print any readable regular file:bash KNOWN="${QQBOT_KNOWN_USERS:-$HOME/.openclaw/qqbot/data/known-users.json}"The script does not transmit this information over the network. Exposure occurs through terminal output, agent transcripts, command logs, CI logs, or support records where the output is subs ...[truncated 1479 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace full known-user output with a record count and redacted identifiers by default.
- Add an explicit option such as
--include-sensitive-detailsbefore displaying raw user records or service logs. - Print only explicitly approved binding fields rather than complete binding objects.
- Mask application identifiers and credential paths, showing only a short suffix or whether a configured file exists.
- Avoid displaying service logs by default; report only service state unless verbose diagnostic output is explicitly requested.
- Validate and canonicalize
QQBOT_KNOWN_USERS, then require it to remain under the expected OpenClaw data directory. - Reject symlinks or unexpected file types when reading the known-users file.
- Warn operators that verbose diagnostic output may contain sensitive information and should be sanitized before sharing.
- Ensure diagnostic transcripts and CI logs have restricted access and appropriate retention controls.
