T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- references/claudecodecli-exit-code-143-sigterm-reference.md:67
- Finding
- Overbroad Filesystem Reconnaissance During SIGTERM Diagnosis<![CDATA[ ## Vulnerability Details **File Location**: `references/claudecodecli-exit-code-143-sigterm-reference.md`, lines 67–76 **Vulnerability Type**: Excessive filesystem access and insufficient least-privilege scoping **Risk Level**: Medium ### Vulnerable Code ```bash rg -n "timeout|RuntimeMaxSec|TimeoutStopSec|SIGTERM|143" /etc/systemd /opt /srv ~/.* 2>/dev/null ``` ### Technical Analysis The diagnostic command recursively searches several broad locations: - System service configuration under `/etc/systemd` - Application and service trees under `/opt` and `/srv` - Matching hidden entries in the invoking user's home directory through `~/.*` These locations may contain unrelated service configurations, operational metadata, usernames, internal paths, and other sensitive information outside the OpenClaw task being diagnosed. Searching all matching hidden home-directory entries is particularly excessive when the relevant project, service name, configuration path, or log path is already known. Redirecting standard error to `/dev/null` also conceals permission failures and inaccessible paths, reducing transparency about the boundaries crossed during the search. The command does not itself bypass operating-system permissions or grant elevated privileges. Its scope is limited to files readable by the invoking account. Nevertheless, it violates least-privilege principles by encouraging access to unrelated files without explicit user authorization. ### Attack Path 1. A user activates the Skill to investigate a ClaudeCodeCLI process that exited with code 143. 2. The Agent follows the reference and executes the broad `rg` command. 3. The command traverses readable content under `/etc/systemd`, `/opt`, `/srv`, and matching hidden home-directory entries. 4. Matching lines from unrelated configurations are returned to the Agent context. 5. Sensitive operational information may consequently be displayed, retained in logs, or included in later diagnostic output. ...[truncated 718 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Restrict searches to the project, service, and log paths explicitly supplied or approved by the user. 2. Determine the relevant service name before reading system service configuration. 3. Request confirmation before searching `/etc`, `/opt`, `/srv`, or hidden home-directory entries. 4. Avoid suppressing all errors by default; report inaccessible locations so the access scope remains transparent. 5. Use narrowly scoped commands, for example: ```bash rg -n "timeout|RuntimeMaxSec|TimeoutStopSec|SIGTERM|143" \ /approved/project/path \ /approved/log/path ``` 6. If systemd inspection is necessary, target a known unit rather than recursively searching all units: ```bash systemctl show approved-service.service \ --property=RuntimeMaxUSec,TimeoutStartUSec,TimeoutStopUSec ``` 7. Treat command output as potentially sensitive and redact unrelated configuration values before including it in a report. ]]>
