Back to skill

Security audit

Olares Files (olares-cli files)

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only skill for using Olares file-management commands, with high-impact actions mostly disclosed and scoped to the active Olares account.

Install only if you intend to let the agent help manage Olares files. Review public-share and SMB actions carefully: confirm target folders, expiration, recipients, and permissions, prefer generated or strong passwords, and avoid putting passwords directly in shell commands when a prompt or stdin option is available.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
references/olares-files-share.md:63
Finding

Weak Public-Share Password Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: references/olares-files-share.md, lines 63–65
Vulnerability Type: Public-share credential exposure and weak example password
Risk Level: Medium

bash
# Public upload-only inbox with explicit password + size cap.
olares-cli files share public drive/Home/Inbox/ --upload-only \
    --password drop --expire-days 30 --upload-size-limit 100M

Technical Analysis

The example supplies the public-share password through the --password command-line argument. Command-line secrets can be retained in shell history and may be visible to local process-monitoring tools while the command executes.

The literal password drop is also short and predictable. Because the share is publicly reachable to anyone possessing its URL and password, documentation that encourages a weak credential increases the risk of unauthorized access. Although this is an example rather than a hardcoded production credential, users may copy it directly.

Attack Path

  1. A user copies the documented command and creates a public upload-only share using drop as its password.
  2. The command, including the password, is retained in shell history or observed through local process inspection.
  3. An attacker obtains or discovers the corresponding public-share URL.
  4. The attacker uses the exposed or predictable password before the 30-day expiration.
  5. The attacker gains the upload capability granted by the public share and may place unauthorized content into the shared directory.

Impact Assessment

Exploitation does not grant general Olares account access or expose authentication tokens. It grants the permissions configured for the affected public share. In this example, the attacker could upload files into the selected inbox until the link expires or its password is changed. This may enable unauthorized storage consumption, malicious file placement, or abuse of workflows that process uploaded conte ...[truncated 3 chars]

Remediation
View remediation

Remediation Suggestions

  • Add public-share support for --password-stdin or secure file-descriptor input.
  • Replace the literal password with an auto-generated password or a clearly marked secure-input placeholder.
  • Warn users that --password can expose credentials through process arguments and shell history.
  • Prefer the CLI's documented random-password generation behavior when an explicit password is unnecessary.
  • Require sufficiently long, randomly generated passwords when users provide credentials explicitly.
  • Advise users to transmit the share URL and password through separate secure channels.

T09 · Insecure Skill Coding Practices

Warning
Location
references/olares-files-share.md:102
Finding

Environment-Sourced Public-Share Password Exposed in Process Arguments

Content
View full analysis

Vulnerability Details

File Location: references/olares-files-share.md, line 102
Vulnerability Type: Sensitive credential passed through command-line arguments
Risk Level: Medium

bash
SHARE_ID=$(olares-cli files share public drive/Home/Photos/ --expire-days 7 --password "$PW" --json | jq -r '.id')

Technical Analysis

Expanding $PW as the value of --password places the actual public-share password in the invoked process's argument vector. The shell history will ordinarily retain the variable reference rather than its expanded value, but local process inspection, command auditing, debugging output, or wrappers around olares-cli may capture the expanded credential.

This is inconsistent with the safer --password-stdin pattern documented for SMB credentials elsewhere in the Skill. Public-share passwords protect remotely accessible data and should receive equivalent handling.

Attack Path

  1. A user stores a public-share password in the PW environment variable.
  2. The user executes the documented command.
  3. The shell expands $PW and passes the plaintext value as an argument to olares-cli.
  4. A local user or monitoring process observes or records the process arguments.
  5. The attacker obtains the generated share URL or share identifier.
  6. Before the seven-day expiration, the attacker authenticates to the public share with the captured password and accesses the shared content according to its configured permissions.

Impact Assessment

The attacker can obtain the permissions associated with the affected public share, potentially including directory listing, downloading, or uploading. The exposure is limited to the selected shared directory and the share's lifetime; it does not directly disclose the Olares access token or grant unrestricted account access.

Remediation
View remediation

Remediation Suggestions

  • Implement and document --password-stdin for public-share creation and password rotation.
  • Pass the password through standard input without echoing it, rather than expanding it into the argument vector.
  • Ensure debug logs, JSON output, and error messages never include the supplied or generated password unnecessarily.
  • If secure standard-input support is unavailable, prefer automatic password generation and clearly disclose the remaining output-handling risk.
  • Document secure deletion or unsetting of temporary password variables after use.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (17)

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 140)May include surrounding context.

md
| `<src> does not exist on the server` (from `cp`/`mv`/`rm`) | Preflight Stat failed | `files ls` the parent and confirm the path |
| `HTTP 500` from `/api/resources/<file>` | Quirk #2 — backend tried to embed file bytes | Use `files cat` / `files download` instead |

For auth-related errors (`server rejected the access token`, `refresh token for X became invalid`, …) see [`../olares-shared/SKILL.md`](../olares-shared/SKILL.md).

## Safety contract

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/olares-files-edit.md (reported line 49)May include surrounding context.

md
## Agent notes

- If the user exits the editor without changes, **no PUT is issued** (byte-for-byte comparison; robust against editors that always rewrite). No warning needed.
- **Concurrent-delete detection**: if Stat says the file exists but the subsequent GET returns 404, the verb refuses with `file disappeared between stat and fetch`. Do NOT retry — re-pull the parent and ask the user what to do.
- `--keep-temp` is the right escape hatch when an unexpected size-cap rejection or NUL-byte sniff blocks the writeback — point the user at the temp path so they can recover bytes manually.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-mkdir.md (reported line 35)May include surrounding context.

md
## Agent notes

- **Always `-p` when chaining mkdir → upload.** `upload` does NOT pre-create directories (because of quirk #1), so the cheapest pattern is `mkdir -p <dest-dir> && upload <local> <dest-dir>`.
- After a non-`-p` mkdir, if the user wonders why they see `Foo (1)`, the answer is "you ran mkdir on an existing dir". The fix: `files rm -r drive/Home/Foo (1)/` (the bytes inside `Foo` are untouched).

## Common errors

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · references/olares-files-rename.md (reported line 47)May include surrounding context.

md
|---|---|---|
| `refusing to rename drive/Home/<protected-name>` | Quirk #4 | Pick a different target |
| `new name must be a bare basename` | `<new-name>` contains `/` | Drop the slash; use `mv` if you actually want to move |
| `new name is empty` / `cannot rename to . or ..` | Invalid basename | Provide a real name |
| `path contains . or .. segments` | Path-traversal blacklist | Use a clean path |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 62)May include surrounding context.

md
- **Destructive verb — confirm intent with the user before invocation.** The CLI prompts y/N by default; `-f` skips the prompt.
- **`-f` does NOT bypass the preflight existence check** — a missing path still aborts (safer-than-Unix `rm -f`). This means a typo cannot half-delete a batch.
- **Trailing slash signals directory intent.** Without `-r`, `rm drive/Home/Foo/` errors with "<Foo> is a folder, pass -r". Without trailing slash AND target is actually a dir, errors with the same CTA.
- **Protected names** ([quirk #4](../SKILL.md#4-drivehomepictures-music-movies-downloads-documents-code-cache-data-home-ollama-huggingface-are-system-managed)) are refused at the first level under `drive/Home/` only; deeper paths (`drive/Home/Pictures/Trip2024/`) are fully deletable.

## Examples

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-rm.md (reported line 12)May include surrounding context.

md
- **Destructive verb — confirm intent with the user before invocation.** The CLI prompts y/N by default; `-f` skips the prompt.
- **`-f` does NOT bypass the preflight existence check** — a missing path still aborts (safer-than-Unix `rm -f`). This means a typo cannot half-delete a batch.
- **Trailing slash signals directory intent.** Without `-r`, `rm drive/Home/Foo/` errors with "<Foo> is a folder, pass -r". Without trailing slash AND target is actually a dir, errors with the same CTA.
- **Protected names** ([quirk #4](../SKILL.md#4-drivehomepictures-music-movies-downloads-documents-code-cache-data-home-ollama-huggingface-are-system-managed)) are refused at the first level under `drive/Home/` only; deeper paths (`drive/Home/Pictures/Trip2024/`) are fully deletable.

## Examples

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-rm.md (reported line 18)May include surrounding context.

Examples

bash
olares-cli files rm drive/Home/Documents/old.pdf
olares-cli files rm -r drive/Home/Backups/2024
olares-cli files rm -r drive/Home/Backups/2024/
olares-cli files rm -rf drive/Home/junk drive/Home/scratch/

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-rm.md (reported line 19)May include surrounding context.

bash
olares-cli files rm drive/Home/Documents/old.pdf
olares-cli files rm -r drive/Home/Backups/2024
olares-cli files rm -r drive/Home/Backups/2024/
olares-cli files rm -rf drive/Home/junk drive/Home/scratch/

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-rm.md (reported line 20)May include surrounding context.

bash
olares-cli files rm drive/Home/Documents/old.pdf
olares-cli files rm -r drive/Home/Backups/2024
olares-cli files rm -r drive/Home/Backups/2024/
olares-cli files rm -rf drive/Home/junk drive/Home/scratch/

# Batch: two siblings + one cross-parent — collapses into 2 DELETE calls.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The documentation includes a force-recursive batch deletion example using -rf, which suppresses the interactive prompt for multiple directory targets. Even though the skill also documents preflight checks and confirmation norms, this example may normalize unsafe agent behavior and make it easier to perform high-impact deletions without an additional consent step.

Content

Scanner excerpt · references/olares-files-rm.md (reported line 21)May include surrounding context.

md
olares-cli files rm drive/Home/Documents/old.pdf
olares-cli files rm -r drive/Home/Backups/2024
olares-cli files rm -r drive/Home/Backups/2024/
olares-cli files rm -rf drive/Home/junk drive/Home/scratch/

# Batch: two siblings + one cross-parent — collapses into 2 DELETE calls.
olares-cli files rm drive/Home/a.pdf drive/Home/b.pdf sync/<repo>/old.md

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-rm.md (reported line 24)May include surrounding context.

olares-cli files rm -rf drive/Home/junk drive/Home/scratch/

Batch: two siblings + one cross-parent — collapses into 2 DELETE calls.

olares-cli files rm drive/Home/a.pdf drive/Home/b.pdf sync//old.md

text

## Preflight existence check

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · references/olares-files-smb.md (reported line 69)May include surrounding context.

olares-cli files smb unmount

Remove a favorite by URL.

olares-cli files smb history rm //host.local/Public

text

## Wire shape

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 · references/olares-files-smb.md (reported line 79)May include surrounding context.

POST /api/unmount/external///?external_type=smb (unmount) GET /api/smb_history// (history list) PUT /api/smb_history// body: array (history upsert) DELETE /api/smb_history// body: array of {url} (history rm)

text

## Agent notes

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · references/olares-files-upload.md (reported line 60)May include surrounding context.

Wire protocol (Drive v2 / Resumable.js-compatible)

text
1. GET /upload/upload-link/<node>/...            → upload session
2. GET /upload/file-uploaded-bytes/<node>/...    → server-driven resume offset
3. POST chunks (8 MiB default) with
        Content-Range: bytes <start>-<end>/<total>

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/olares-files-edit.md (reported line 6)May include surrounding context.

md
> **Prerequisite:** Read [`../../olares-shared/SKILL.md`](../../olares-shared/SKILL.md) and the parent [`../SKILL.md`](../SKILL.md) first.
> **Flags & wire shape:** `olares-cli files edit --help`.

Edit a single existing file in-place by opening it in `$EDITOR`. **UPDATE-only verb** — the server-side `PUT /api/resources/<encPath>` handler is wired as "replace bytes of an existing file"; it does NOT create new files. To materialize a new file, use `files upload` from a local source.

## Safety constraints

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/olares-files-edit.md (reported line 39)May include surrounding context.

Editor cascade

Matches git commit / crontab -e:

text
--editor flag  →  $VISUAL  →  $EDITOR  →  vi (POSIX) / notepad (Windows)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill provides copy-pastable commands and an agent flow that create and return a public share URL, but it does not prominently warn that this action exposes directory contents to anyone possessing the link and password until expiration. In an agent context, this omission can normalize risky data-sharing behavior and cause accidental disclosure of sensitive files, especially if the agent automates link creation and surfaces the URL directly in chat or logs.

Content

No source excerpt is available for this finding.