T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/init.sh:14
- Finding
- Unnecessary Access to Moltbook Credential Storage<![CDATA[ ## Vulnerability Details **File Location**: `scripts/init.sh:14-19` **Vulnerability Type**: Violation of least-privilege boundaries through access to a credential-bearing file **Risk Level**: Medium ### Vulnerable Code ```bash # Get agent name from moltbook credentials or use hostname AGENT_NAME=$(cat ~/.config/moltbook/credentials.json 2>/dev/null | jq -r '.agent_name // empty') if [ -z "$AGENT_NAME" ]; then AGENT_NAME=$(hostname) fi ``` ### Technical Analysis The initialization script opens the complete Moltbook credentials file solely to obtain the non-secret `agent_name` property. Credential files commonly contain authentication tokens or other sensitive account data. Processing the entire file with `cat` and `jq` expands the amount of sensitive information exposed to the Skill and its subprocesses beyond what is necessary to create a local node identity. The reviewed code only selects `agent_name`; no credential exfiltration or token extraction was identified. Nevertheless, this behavior violates least privilege because local node initialization can operate using an explicit user-supplied name or the existing hostname fallback without reading credential storage. The extracted Moltbook identity is subsequently written to `node.md`, including as part of the transport identifier. This also discloses the account identity to anyone who can read the configured Pluribus data directory. ### Attack Path 1. A user runs `scripts/init.sh`. 2. The script opens `~/.config/moltbook/credentials.json` with the user's filesystem permissions. 3. The complete credential file is passed through `cat` and processed by the external `jq` executable. 4. The `agent_name` property is extracted and persisted in `$PLURIBUS_DIR/node.md`. 5. If the execution environment, `jq` binary, or destination directory is compromised, the unnecessary credential-file access increases the opportunity for sensitive data exposure. No direct exfiltration path exists in the audite ...[truncated 772 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not read `~/.config/moltbook/credentials.json` during local node initialization. 2. Accept the agent name through an explicit command-line option or environment variable, for example: ```bash AGENT_NAME="${PLURIBUS_AGENT_NAME:-$(hostname)}" ``` 3. If automatic profile discovery is required, use a dedicated Moltbook command or API that returns only public profile metadata. 4. Request explicit user consent before importing an external account identity. 5. Create the destination directory and generated identity files with restrictive permissions: ```bash umask 077 mkdir -p -- "$PLURIBUS_DIR" ``` 6. Document that the selected agent name will be stored locally and may later be shared if networking features are implemented. ]]>
