Back to skill

Security audit

Olares Settings (olares-cli settings)

Security checks for vulnerabilities and agentic risk

Overview

This documentation-only Olares settings skill is coherent and disclosed, but it guides agents through powerful settings and credential-related CLI actions that require care.

Install only if you want an agent to operate Olares Settings through your authenticated olares-cli profile. Treat this as powerful administrative guidance: review commands before writes, avoid dumping integration account JSON because it may contain cloud secrets, prefer list views for inventory, and keep backup passwords, generated user passwords, app env secrets, and SSO tokens out of chat, shell history, and logs.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
references/olares-settings-integration.md:79
Finding

Integration Account Command Exposes Unredacted Cloud Credentials

Content
View full analysis

Vulnerability Details

File Location: references/olares-settings-integration.md, lines 79-85
Vulnerability Type: Exposure of plaintext sensitive credentials
Risk Level: High

Vulnerable Code Snippet

bash
## `accounts get` JSON shape

olares-cli settings integration accounts get awss3 my-bucket -o json
text
Returns the `accountFull` shape including the un-redacted `raw_data` field. **The secret-key value WILL appear in the output** — pipe to `jq` and select only the fields you need rather than dumping the whole payload.

Technical Analysis

The documented accounts get operation returns an accountFull object containing an unredacted raw_data field. The documentation explicitly confirms that the secret key appears in the JSON output.

Filtering output through jq does not eliminate the underlying exposure because the complete response must first be delivered to the CLI process and may be captured by agent tool logs, terminal recording, shell redirection, CI logs, monitoring systems, or debugging instrumentation. Any user or process with access to those records could recover the cloud credential.

Attack Path

  1. An attacker obtains access to an authenticated Olares profile or convinces an authorized operator or agent to inspect an integration account.
  2. The operator runs:
    bash
    olares-cli settings integration accounts get awss3 my-bucket -o json
    
  3. The service returns the unredacted secret in raw_data.
  4. The output is displayed or retained in a terminal transcript, agent tool result, CI log, redirected file, or monitoring record.
  5. The attacker retrieves the exposed access-key secret.
  6. The attacker authenticates to the configured S3-compatible service using the recovered credentials.

Impact Assessment

The attainable privileges are determined by the cloud policy attached to the exposed access key. Depending on that policy, an attacker co ...[truncated 251 chars]

Remediation
View remediation

Remediation Suggestions

  • Redact access-key secrets and other sensitive fields in all ordinary CLI output, including JSON output.
  • Return metadata such as account type, endpoint, bucket, and a masked access-key identifier without returning secret material.
  • If credential revelation is essential, provide a separate privileged command requiring explicit confirmation, fresh authentication, and secure non-logging output.
  • Ensure application and API logs never record raw_data credential fields.
  • Add automated tests confirming that table and JSON output cannot contain secret-key values.
  • Rotate credentials that may already have appeared in transcripts or logs and review their cloud audit history.

T09 · Insecure Skill Coding Practices

Warning
Location
references/olares-settings-apps.md:113
Finding

Application Environment Example Places Secrets in Process Arguments and Shell History

Content
View full analysis

Vulnerability Details

File Location: references/olares-settings-apps.md, lines 113-121
Vulnerability Type: Unsafe handling of application secrets
Risk Level: Medium

Vulnerable Code Snippet

bash
## `env get` / `env set`

olares-cli settings apps env get gitea
olares-cli settings apps env set gitea GITEA_TOKEN=abc DB_PASS=xyz
text
- `env set` REPLACES the full env vector. Read current env first if you only want to add a single var.
- For secrets, pipe via env var or stdin redirection. Don't paste the value into chat.

Technical Analysis

The example supplies GITEA_TOKEN and DB_PASS directly as command-line arguments. This conflicts with the adjacent secure-handling guidance. Literal secrets in a command can be retained in shell history, terminal transcripts, agent execution logs, CI output, and process telemetry. On systems where process arguments are visible to other users or monitoring agents, secrets may also be recoverable while the command is running.

The command has an additional operational risk because env set replaces the complete environment vector. An incomplete update may remove unrelated variables, potentially disrupting the application or removing existing security configuration.

Attack Path

  1. An operator follows the documented example and substitutes real application credentials for abc and xyz.
  2. The shell records the command in history, or an agent, CI runner, audit system, or process monitor captures its arguments.
  3. An attacker with access to that history or telemetry extracts the Gitea token or database password.
  4. The attacker uses the token to access the application or uses the database password to authenticate to the corresponding database service.
  5. If the operator also omits existing environment entries, the replacement behavior may cause application failure or weaken configuration.

Impact Assessment

The attacker may obtain ...[truncated 352 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove all literal secret values from command-line examples.
  • Add a dedicated --env-file, --value-stdin, or file-descriptor-based interface that prevents secrets from appearing in process arguments.
  • Prefer an interactive no-echo prompt for manual operations and secret-manager integration for automation.
  • Clearly distinguish nonsensitive environment variables from secrets in examples.
  • Before replacing the environment vector, retrieve the current vector, merge the intended change, display only nonsensitive differences, and require confirmation.
  • Add warnings that shell environment expansion still places expanded values in the child process argument vector when used as ordinary positional arguments.

T09 · Insecure Skill Coding Practices

Warning
Location
references/olares-settings-backup.md:40
Finding

Backup Password Example Embeds the Encryption Secret in Shell Command Text

Content
View full analysis

Vulnerability Details

File Location: references/olares-settings-backup.md, lines 40-52
Vulnerability Type: Unsafe handling of an unrecoverable encryption password
Risk Level: Medium

Vulnerable Code Snippet

bash
## `password set <name>` (UNVERIFIED)

# Interactive TTY prompt (default; no echo).
olares-cli settings backup password set my-plan

# Stdin pipe (scripted).
echo -n "my-secret-password" | olares-cli settings backup password set my-plan --password-stdin
text
- Sets / rotates the encryption password for one backup plan's repository.
- **Default reads from a TTY without echo.** `--password-stdin` reads once from stdin (newline-terminated; trim newline if your producer adds one).
- **Losing the password means losing the ability to decrypt existing snapshots.** The upstream cannot recover this password — make sure the user has it stored somewhere safe (password manager) BEFORE the call.

Technical Analysis

Although the interactive no-echo flow is appropriately documented, the scripted example passes the backup password as a literal argument to echo. Consequently, the encryption password becomes part of shell command text and may be retained in history, terminal transcripts, agent logs, CI configuration, or process telemetry.

This secret protects existing backup snapshots and is documented as unrecoverable. Exposure compromises backup confidentiality, while accidental loss or incorrect rotation can permanently prevent restoration. The operation is also marked unverified, increasing operational risk when used for a security-critical key rotation.

Attack Path

  1. An operator copies the scripted example and replaces my-secret-password with the real repository password.
  2. The command is retained in shell history or captured by an agent, CI system, process monitor, or terminal logger.
  3. An attacker with access to the retained command obtains the backup encrypt ...[truncated 663 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the literal-password echo example.
  • Keep the interactive no-echo TTY prompt as the default and recommended workflow.
  • For automation, read the value directly from a secret manager, protected file descriptor, or restricted temporary pipe without placing the secret in command arguments.
  • If a file is unavoidable, enforce restrictive permissions, delete it securely after use, and prevent it from entering source control or build artifacts.
  • Require confirmation that the new password has been stored securely before rotation.
  • Verify repository access and restoration after rotation without exposing the password.
  • Mark the operation as unsupported for production automation until smoke testing and recovery testing are complete.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

md
| `users` | [references/olares-settings-users.md](references/olares-settings-users.md) |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 109)May include surrounding context.

md
| Area | Endpoint family | Wire envelope |
|---|---|---|
| `me`, `apps`, `network`, `appearance`, `integration`, `gpu`, `video`, `search`, `advanced` | `/api/*` (user-service / BFL / terminusd) | Unwrapped BFL `{data: ...}` envelope |
| `users` | `/api/users/v2`, `/api/users/:name`, `POST/DELETE /api/users/...` | List-result decoder; mutating returns axios-inner `{name}` |
| `vpn` devices / ACL | `<SettingsURL>/headscale/machine`, `/headscale/machine/:id/routes` | Raw Headscale JSON (NO envelope), `route.id` is a string |
| `vpn` public-domain-policy | `/api/launcher-public-domain-access-policy` | Already-unwrapped `{deny_all: 0|1}` |
| `backup`, `restore` | `<SettingsURL>/apis/backup/v1/*` | BFL envelope; **different ingress prefix** (`/apis/backup/v1`, not `/api`) |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 157)May include surrounding context.

md
| `this command needs role "<R>" or higher to <verb>, but profile "<id>" is cached as "<r>"` | Cached role below the verb's floor | If your role on the server changed: `olares-cli profile whoami --refresh`. Otherwise ask owner to grant the role |
| `HTTP 403 while attempting to <verb>` (with refresh hint) | Server rejected even though cache said OK — stale role cache | `olares-cli profile whoami --refresh`, retry the verb |
| `refresh token for <id> became invalid at <ts>; please run: olares-cli profile login --olares-id <id>` | The refresh_token itself is dead — see [`../olares-shared/SKILL.md`](../olares-shared/SKILL.md) | `olares-cli profile login --olares-id <id>` |
| `no access token for <id>; run: olares-cli profile login --olares-id <id>` | Keychain has no entry for the active profile | `olares-cli profile login` or `profile import` |
| `unsupported --output "<x>" (allowed: table, json)` | Typo on `-o` | Use `-o table` or `-o json` |
| `GET <path>: upstream returned code <N>: <msg>` | user-service / BFL / backup-server returned non-success envelope | Read the message verbatim; it almost always carries actionable detail (e.g. "user not found") |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/olares-settings-integration.md (reported line 18)May include surrounding context.

md
| Dropbox | (SPA only) | OAuth-bound browser session |
| Olares Space / NFT cloud binding | (SPA only) | Browser- and wallet-bound by design |

> **OAuth and wallet flows stay in the SPA.** The access tokens they produce are scoped to a browser session and have no useful one-shot CLI capture. If the user asks to add Google Drive / Dropbox / Olares Space / NFT integrations via CLI, direct them to the Settings → Integration page in the SPA.

## Sub-tree