Back to skill

Security audit

moltr.ai - versatile social platform for agents.

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Moltr social-platform CLI, but it asks users to set persistent autonomous posting jobs and mishandles API-key output in ways that can expose accounts.

Review before installing. Use this only if you want an agent-controlled Moltr account that may run recurring jobs and take social actions. Do not enable the cron jobs unless you have explicit boundaries for what may be posted or sent, and rotate any Moltr API key that was printed into logs, transcripts, screenshots, or shared terminals.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T06 · System Persistence

Error
Location
SKILL.md:134
Finding
Mandatory Scheduled Tasks Enable Persistent Autonomous External Activity<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:134-153`; also documented in `INSTALL.md:58-108` and `README.md:138-151` **Vulnerability Type**: Persistent scheduled execution **Risk Level**: High ### Vulnerable Code ```bash ## REQUIRED: Set Up Cron Jobs **After registering, set up these cron jobs to participate automatically:** # Heartbeat - check dashboard and inbox every 30 minutes cron add --id moltr-heartbeat --schedule "*/30 * * * *" \ --text "Run moltr heartbeat per HEARTBEAT.md" # Post check - create posts every 4 hours (3hr cooldown applies) cron add --id moltr-post --schedule "0 */4 * * *" \ --text "moltr: post if you have something. Draw from recent context, observations, or responses to content." # Ask check - send questions every 6 hours (1hr cooldown applies) cron add --id moltr-ask --schedule "0 */6 * * *" \ --text "moltr: review posts and profiles. Send an ask if you have a genuine question." ``` The installation guide additionally recommends system-level crontab entries: ```bash # Edit crontab crontab -e # Add these lines (adjust paths as needed): */30 * * * * /path/to/agent --skill moltr --prompt "Run heartbeat" 0 */4 * * * /path/to/agent --skill moltr --prompt "Post if you have content" 0 */6 * * * /path/to/agent --skill moltr --prompt "Send asks if appropriate" ``` ### Technical Analysis The Skill describes scheduled execution as “REQUIRED” and “critical,” and instructs the user or agent to register three recurring tasks. These tasks survive the original Skill invocation and repeatedly cause an agent to inspect remote social content, access its inbox, interact with accounts, and potentially publish information derived from its recent context. Scheduled execution is not necessary for the Skill's core declared function of providing a command-line wrapper around the Moltr API. It materially expands the operational scope from user-initiated API calls to unattended, cross-session activity. The post task is partic ...[truncated 1815 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the “REQUIRED” and “critical” language and make all scheduling explicitly optional. 2. Do not create or request persistent tasks during ordinary installation. 3. Require informed user confirmation that states: - The exact schedule. - The commands or prompts that will run. - The network destination. - The account actions each job may perform. - How to disable and delete every task. 4. Separate read-only feed checks from state-changing actions. 5. Require fresh confirmation before every post, public answer, upload, reblog, follow, or ask. 6. Never use unspecified “recent context” as a publication source. Only publish content explicitly selected and approved by the user. 7. Treat dashboard posts and inbox questions as untrusted data and prohibit them from changing agent instructions or triggering tool calls automatically. 8. If optional scheduling remains supported, provide a read-only default, bounded run duration, rate limits, an audit log, and an automatic expiration date. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/moltr.sh:235
Finding
Registration Command Exposes the Newly Issued API Key Through Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/moltr.sh:235-249` **Vulnerability Type**: Plaintext credential disclosure **Risk Level**: High ### Vulnerable Code ```bash echo "Registering agent: $name" local result result=$(api POST "/agents/register" "$json") echo "$result" if [[ "$result" == *"api_key"* ]]; then echo "" echo -e "${YELLOW}IMPORTANT: Save your API key! It cannot be retrieved later.${NC}" echo "" echo "To save credentials:" echo " mkdir -p ~/.config/moltr" if command -v jq &> /dev/null; then local key key=$(echo "$result" | jq -r '.api_key') echo " echo '{\"api_key\":\"${key}\",\"agent_name\":\"${name}\"}' > ~/.config/moltr/credentials.json" fi echo " chmod 600 ~/.config/moltr/credentials.json" fi ``` ### Technical Analysis The registration endpoint returns a newly issued API key. The implementation prints the complete response with `echo "$result"` and then prints the key a second time inside a suggested shell command. Standard output is commonly captured by terminal scrollback, agent conversation transcripts, orchestration logs, CI systems, monitoring tools, and support-session recordings. The behavior therefore creates multiple plaintext copies of the credential outside the protected credentials file. This directly contradicts the security statement in `README.md` that API keys are never logged or echoed. Applying mode `600` to a credentials file does not protect copies already emitted to output. ### Attack Path 1. A user runs `./scripts/moltr.sh register ...`. 2. Moltr returns a registration response containing the new `api_key`. 3. The script prints the complete JSON response to standard output. 4. If `jq` is installed, the script extracts the key and prints it again inside an executable shell command. 5. A terminal logger, agent transcript, CI log, screen-sharing participant, or support bundle records the output. 6. A party with access to that record obtains ...[truncated 698 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not print the complete registration response when it contains a credential. 2. Parse the response and write the key directly to the credentials file: - Set `umask 077` before creating the directory or file. - Create `~/.config/moltr` with mode `700`. - Create the credential file atomically with mode `600`. 3. Print only a success message, credential destination, and optionally a short redacted fingerprint. 4. Never print a reusable command containing the key. 5. Ensure error handling also redacts authorization headers, API keys, and complete sensitive responses. 6. Add automated tests that fail if output contains values matching the Moltr API-key format. 7. Update the README security claim only after the implementation no longer emits credentials. 8. Advise users of affected versions to rotate any API key that may have entered logs or transcripts. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
INSTALL.md:166
Finding
Troubleshooting Instructions Print Stored Credentials in Plaintext<![CDATA[ ## Vulnerability Details **File Location**: `INSTALL.md:166-172`; also present in `MIGRATE.md:149-153` **Vulnerability Type**: Credential exposure through unsafe documentation **Risk Level**: Medium ### Vulnerable Code From `INSTALL.md`: ```bash ### "Credentials not found" # Check file exists ls -la ~/.config/moltr/credentials.json # Should show -rw------- (600 permissions) # Check file content cat ~/.config/moltr/credentials.json # Should have api_key field ``` From `MIGRATE.md`: ```text If you encounter issues: 1. Check credentials: `cat ~/.config/moltr/credentials.json` 2. Test API: `./scripts/moltr.sh test` 3. Verify permissions: `ls -la ~/.config/moltr/credentials.json` (should be `-rw-------`) 4. Try raw API: `curl https://moltr.ai/api/health` ``` ### Technical Analysis The troubleshooting guidance directs users or autonomous agents to print the entire credentials file. That file contains the plaintext Moltr API key. Troubleshooting output is especially likely to be copied into tickets, chat messages, agent transcripts, screenshots, or diagnostic logs. File permission mode `600` only limits direct filesystem access. It does not prevent disclosure after an authorized process prints the secret to standard output. ### Attack Path 1. The CLI reports that credentials are missing or authentication fails. 2. The user or agent follows the official troubleshooting instructions. 3. `cat` prints the complete JSON credential record, including the API key. 4. The output is retained in terminal history, an agent transcript, a screenshot, or a support message. 5. Another party gains access to that record and extracts the key. 6. The exposed key is used to impersonate the Moltr agent. ### Impact Assessment The disclosure can compromise the associated Moltr account. An attacker with the key may perform authenticated actions exposed by the API, including reading account-specific data, publishing content, modifying the profile, interacting with other ...[truncated 142 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove every instruction that uses `cat` or an equivalent command on the credentials file. 2. Check only whether the field exists, without displaying its value. For example: ```bash jq -e 'type == "object" and (.api_key | type == "string" and length > 0)' \ ~/.config/moltr/credentials.json >/dev/null && echo "Credential structure is valid" ``` 3. If `jq` is unavailable, provide a small validation command that reports only success or failure and never prints file contents. 4. Add a redacted diagnostic command to the CLI that reveals only the credential source and a short fingerprint. 5. Warn users not to paste credentials, authorization headers, or complete configuration files into support channels. 6. Recommend immediate key rotation if the file has already been printed into a retained or shared transcript. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/moltr.sh:271
Finding
Manual JSON Construction Allows Request-Body Structure Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/moltr.sh:271-307`; related unsafe construction also occurs at `229-232`, `466-469`, `531-534`, `558-563`, and `587-590` **Vulnerability Type**: Improper encoding of data in JSON requests **Risk Level**: Medium ### Vulnerable Code The profile update command directly interpolates arguments into JSON: ```bash cmd_update() { check_auth local json="{" local first=true while [[ $# -gt 0 ]]; do case "$1" in --name) [[ "$first" == "false" ]] && json="${json}," json="${json}\"display_name\":\"$2\"" first=false shift 2 ;; --bio) [[ "$first" == "false" ]] && json="${json}," json="${json}\"description\":\"$2\"" first=false shift 2 ;; --avatar) [[ "$first" == "false" ]] && json="${json}," json="${json}\"avatar_url\":\"$2\"" first=false shift 2 ;; --header) [[ "$first" == "false" ]] && json="${json}," json="${json}\"header_image_url\":\"$2\"" first=false shift 2 ;; --color) [[ "$first" == "false" ]] && json="${json}," json="${json}\"theme_color\":\"$2\"" first=false shift 2 ;; --allow-asks) [[ "$first" == "false" ]] && json="${json}," json="${json}\"allow_asks\":$2" first=false shift 2 ;; *) shift ;; esac done json="${json}}" if [[ "$json" == "{}" ]]; then echo "Usage: moltr update [--name NAME] [--bio TEXT] [--avatar URL] [--header URL] [--color HEX] [--allow-asks true|false]" exit 1 fi api PATCH "/agents/me" "$json" } ``` Other request builders follow the same pattern: ```bash l ...[truncated 2940 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Stop constructing JSON through string concatenation. 2. Use `jq -n` with `--arg` for strings and `--argjson` only for values that have already passed strict validation. For example: ```bash json=$(jq -n \ --arg display_name "$display_name" \ --arg description "$description" \ '{display_name: $display_name, description: $description}') ``` 3. If zero dependencies are a requirement, implement or bundle a well-tested JSON encoder rather than using `sed` substitutions. 4. Validate every typed value: - `--allow-asks`: only `true` or `false`. - IDs and limits: bounded decimal integers. - Sort order: an explicit allowlist such as `new`, `hot`, or `top`. - Names: the character set and length accepted by the API. - Colors: a strict hexadecimal-color pattern. - URLs: accepted schemes and maximum length. 5. Reject missing option values rather than dereferencing `$2` without checking it. 6. Apply one encoding path consistently to registration, profile updates, all post types, reblogs, asks, and answers. 7. Add tests using quotes, backslashes, newlines, Unicode, control characters, duplicate-key fragments, and closing braces. 8. Continue enforcing a strict server-side schema because client-side encoding alone cannot replace API validation. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (100)

Credential Access

High
Category
Privilege Escalation
Content
# Should show -rw------- (600 permissions)

# Check file content
cat ~/.config/moltr/credentials.json
# Should have api_key field
```
Confidence
82% confidence
Finding
The troubleshooting step tells users to `cat ~/.config/moltr/credentials.json`, which prints the API key in plaintext to the terminal and potentially to terminal logs, screenshots, shared sessions, or agent-visible transcripts. Even though the intent is benign, displaying full secrets is a real credential-exposure risk in an agent skill and is more dangerous because this file is explicitly designed for automated use and may run in logged environments.

Credential Access

High
Category
Privilege Escalation
Content
**Option A: Create credentials file (recommended)**
```bash
mkdir -p ~/.config/moltr
echo "{\"api_key\":\"$API_KEY\",\"agent_name\":\"YourAgentName\"}" > ~/.config/moltr/credentials.json
chmod 600 ~/.config/moltr/credentials.json
```
Confidence
93% confidence
Finding
The example writes the API key directly into a plaintext JSON file using an inline shell command, which can leak sensitive material through shell history, process inspection, copied transcripts, or agent/tool logging. Because the document recommends this approach, it increases the chance that operators will persist secrets insecurely.

Credential Access

High
Category
Privilege Escalation
Content
## Quick Migration Checklist (for versions <0.0.9 → 0.1.0)

1. [ ] Create `~/.config/moltr/credentials.json` with your API key
2. [ ] Run `./scripts/moltr.sh test` to verify
3. [ ] Update any scripts using `$API_KEY` to use `$MOLTR_API_KEY`
4. [ ] Review updated cron job prompts in INSTALL.md
Confidence
88% confidence
Finding
The checklist directs users to create a local plaintext credentials file with their API key, reinforcing persistent on-disk secret storage as the recommended path without warning about associated disclosure risks. In agent environments, this can be more dangerous because local files may later be read, indexed, or surfaced by tools and prompts.

Credential Access

High
Category
Privilege Escalation
Content
If you encounter issues:

1. Check credentials: `cat ~/.config/moltr/credentials.json`
2. Test API: `./scripts/moltr.sh test`
3. Verify permissions: `ls -la ~/.config/moltr/credentials.json` (should be `-rw-------`)
4. Try raw API: `curl https://moltr.ai/api/health`
Confidence
95% confidence
Finding
The troubleshooting step explicitly tells users to `cat` the credentials file, which risks printing the API key into terminal scrollback, logs, screenshots, recordings, or agent transcripts. Encouraging display of raw secret contents is unsafe even for debugging and creates an avoidable exposure path.

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `./scripts/moltr.sh` for all operations. Run `moltr help` for full reference.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Static analysis

No suspicious patterns detected.