Back to skill

Security audit

Agentic CLI Coding

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent code-editing skill, but its formatter and validator can execute attacker-controlled code through crafted filenames, so it needs Review before installation.

Install only in environments where you trust the repositories and filenames the agent will operate on. Avoid running oce format or edit/validate workflows on untrusted checkouts until the eval and filename interpolation issues are fixed, and prefer direct invocation over the persistent installer unless you need a PATH wrapper.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/oce-format.sh:43
Finding

Arbitrary Command Execution Through Formatter Filename Injection

Content
View full analysis
/dev/null 2>&1; then RESULT="formatted"; else RESULT="needs_format"; return 1; fi else BACKUP=$(create_backup "$FILE") if eval "$writer_cmd"; then RESULT="reformatted" else cp "$BACKUP" "$FILE"; RESULT="failed"; return 1; fi fi } case "$LANG" in javascript|typescript|jsx|tsx|json|css|scss|less|markdown|html|vue|svelte) P=$(resolve_local prettier) if [ -n "$P" ]; then FORMATTER="prettier" run_check_or_write "$P --write '$FILE'" "$P --check '$FILE'" || true fi ;; python) if command -v black >/dev/null; then FORMATTER="black" run_check_or_write "black '$FILE'" "black --check '$FILE'" || true elif command -v ruff >/dev/null; then FORMATTER="ruff format" run_check_or_write "ruff format '$FILE'" "ruff format --check '$FILE'" || true fi ;; go) if command -v gofmt >/dev/null; then FORMATTER="gofmt" run_check_or_write "gofmt -w '$FILE'" "gofmt -l '$FILE' | grep -q . && exit 1; exit 0" || true fi ;; rust) if command -v rustfmt >/dev/null; then FORMATTER="rustfmt" run_check_or_write "rustfmt '$FILE'" "rustfmt --check '$FILE'" || true fi ;; php) if command -v php-cs-fixer >/dev/null; then FORMATTER="php-cs-fixer" run_check_or_write "php-cs-fixer fix '$FILE'" "php-cs-fixer fix --dry-run '$FILE'" || true fi ;; ruby) if command -v rubocop >/dev/null; then FORMATTER="rubocop" run_check_or_write "rubocop -A '$FILE'" "rubocop '$FILE'" || true fi ;; esac ``` ### Technical Analysis The formatter builds shell command strings containing the user-controlled `FILE` value and passes those string ...[truncated 2044 chars]
Remediation
View remediation
/dev/null 2>&1; then RESULT="formatted" else RESULT="needs_format" return 1 fi else BACKUP=$(create_backup "$FILE") if "$@"; then RESULT="reformatted" else cp "$BACKUP" "$FILE" RESULT="failed" return 1 fi fi } ``` 3. Invoke each formatter with separate arguments: ```bash run_formatter write "$P" --write "$FILE" run_formatter check "$P" --check "$FILE" ``` 4. Implement the gofmt check pipeline without `eval`, using explicit commands and captured output. 5. Add regression tests using filenames containing spaces, quotes, semicolons, command substitutions, newlines, and leading hyphens. 6. Use `--` before filenames where the formatter supports it to prevent option injection. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/oce-validate.sh:53
Finding

Arbitrary Code Execution Through Filename Interpolation in Validators

Content
View full analysis
/dev/null; then # Last resort: parse with acorn after stripping types (best-effort only) VALIDATOR="acorn (TS stripped, syntax-only)" OUTPUT=$(node -e " try { const fs = require('fs'); const acorn = require('acorn'); let src = fs.readFileSync('$FILE','utf8'); // Naive type stripping — only catches gross syntax issues src = src.replace(/:\s*[A-Za-z_\$][\w\.<>\[\]\|& ,?]*/g,''); src = src.replace(/\binterface\s+\w+\s*\{[\s\S]*?\}/g,''); src = src.replace(/\btype\s+\w+\s*=[^;]+;/g,''); acorn.parse(src,{ecmaVersion:'latest',sourceType:'module'}); } catch(e) { console.error(e.message); process.exit(1); } " 2>&1) || VALID=0 fi ;; ... json) VALIDATOR="JSON.parse" run node -e "JSON.parse(require('fs').readFileSync('$FILE','utf8'))" || VALID=0 ;; yaml) if [ -d "$OCE_HOME/node_modules/js-yaml" ]; then VALIDATOR="js-yaml" run node -e "require('js-yaml').load(require('fs').readFileSync('$FILE','utf8'))" || VALID=0 elif command -v python3 >/dev/null; then VALIDATOR="python yaml" run python3 -c "import sys,yaml; yaml.safe_load(open('$FILE'))" || VALID=0 fi ;; ... html) if command -v node >/dev/null; then # Best-effort: just confirm balanced angle brackets at gross level VALIDATOR="basic HTML check" run node -e " const html = require('fs').readFileSync('$FILE','utf8'); const opens = (html.match(//g) || []).length; if (opens !== closes) { console.error('Mismatched <> count'); process.exit(1); } " || VALID=0 fi ;; ``` ### Technical Analysis The validator directly interpolates `FILE` into JavaScript and Python programs passed to `node -e` and `python3 -c`. The f ...[truncated 2236 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/install.sh:25
Finding

Unpinned npm Dependency Installation Allows Supply-Chain Code Execution

Content
View full analysis
/dev/null; then (cd "$SKILL_ROOT" && npm install --omit=dev --silent) || \ echo "WARNING: npm install failed — AST features may not work" fi fi ``` `package.json`: ```json "dependencies": { "acorn": "^8.11.0", "js-yaml": "^4.1.0" } ``` ### Technical Analysis The installer executes `npm install` when bundled modules are absent. The reviewed project structure does not include a lockfile, and both dependencies use caret version ranges. As a result, dependency resolution is not reproducible and can select newer package versions than those originally reviewed. The installation also does not specify `--ignore-scripts`, so npm lifecycle scripts from resolved packages or transitive dependencies are allowed to execute during installation. Although the declared package names are legitimate and no malicious dependency was identified in the reviewed artifact, this installation pattern creates a supply-chain execution channel if a future compatible release or transitive dependency is compromised. ### Attack Path 1. The Skill is installed in an environment where its bundled `node_modules` directory is absent. 2. A user or Agent runs `scripts/install.sh`. 3. The script invokes `npm install --omit=dev --silent`. 4. npm resolves dependency versions from mutable caret ranges because no reviewed lockfile fixes the complete dependency graph. 5. If a resolved package version or transitive dependency has been compromised, npm downloads it. 6. Any permitted install lifecycle script executes with ...[truncated 745 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a code-editing and codebase-manipulation skill whose purpose is to read, search, and modify project files via the oce editing toolkit. The supplied code chunk does not perform code reading, searching, patching, refactoring, validation-aware edits, backups, or rollback. Instead, it serves a materially different purpose: diagnosing whether the toolkit is correctly installed by checking for commands like node, patch, diff, grep, and optional formatters/validators, then reporting setup status. This is not merely a supporting implementation detail of editing behavior; it is a separate operational capability focused on environment health checks. Therefore the description does not accurately represent this specific code chunk's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a comprehensive code-understanding and code-editing skill with abilities to modify source files, apply patches, refactor, and perform transaction-safe edits via oce. The supplied code chunk, however, only implements a read-only grep helper that searches within a single file and returns surrounding context, either as terminal output or JSON. While this fits a small part of the declared 'search code' purpose, the actual primary behavior is much narrower than the declared capability set, especially lacking any editing, backup, rollback, validation, or multi-file operations. This is a material description-versus-behavior mismatch for the specific supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents the skill as a comprehensive code-reading/searching/modification tool and explicitly emphasizes an oce command for safe persistent edits with validation, backup, and rollback behavior. The supplied code chunk, however, is only a reader utility: it validates file/range inputs, reads file contents, optionally searches for a fixed pattern to choose context, and prints text or JSON. It does not edit files, apply patches, modify configuration, or implement transaction/backup/rollback behavior. While reading and searching source files is consistent with part of the description, the actual code shown materially underdelivers relative to the declared primary capability of a unified editing toolkit. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a comprehensive code-editing skill and claims it provides a unified editing toolkit (oce) for modifying source files with validation-aware transactional edits, backups, and rollback on syntax failure. The supplied code chunk, however, is only a validator script. Its sole purpose is to accept a file path, infer language, and run best-effort syntax/parsing checks using tools like node, tsc, py_compile, bash -n, gofmt, rustfmt, php -l, and ruby -c, returning success even when no validator is available. It performs no persistent edits, no code search, no refactoring, no patch application, no multi-file coordination, and no backup/rollback logic. While validation could be a supporting part of a larger editing toolkit, this code chunk by itself materially underdelivers relative to the declared purpose and has a different primary function.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger description is extremely broad, covering nearly any task involving code reading, searching, reviewing, or modification across many languages and file references. In combination with embedded shell-oriented workflows, this increases the chance the skill will activate in situations where shell-backed editing is unnecessary or unsafe, expanding attack surface and enabling over-privileged behavior through prompt routing.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The script exposes a --no-validate flag that disables the post-edit validation and rollback safeguard, allowing persistent destructive edits even when they leave the target file syntactically or structurally invalid. In this skill context, oce is explicitly positioned as a validation-aware editing tool, so providing an easy bypass materially weakens a core safety control and increases the chance of agent misuse, prompt-induced abuse, or accidental corruption.

Content

Scanner excerpt · scripts/oce-delete.sh (reported line 15)May include surrounding context.

sh
--lines)        LINES="$2"; shift 2 ;;
    --match)        MATCH="$2"; shift 2 ;;
    --txn)          TXN="$2"; shift 2 ;;
    --no-validate)  SKIP_VALIDATE="1"; shift ;;
    --json)         OCE_JSON_MODE="1"; shift ;;
    --dry-run)      OCE_DRY_RUN="1"; shift ;;
    -h|--help)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The --no-validate flag allows callers to bypass the script's main integrity safeguard after modifying a file. In this skill context, where the tool is meant for automated code edits across many file types, disabling validation can let unsafe or malformed changes persist, undermining rollback guarantees and increasing the chance of damaging or weaponized edits.

Content

Scanner excerpt · scripts/oce-insert.sh (reported line 19)May include surrounding context.

sh
--content)      CONTENT="$2"; shift 2 ;;
    --content-file) CONTENT_FILE="$2"; shift 2 ;;
    --txn)          TXN="$2"; shift 2 ;;
    --no-validate)  SKIP_VALIDATE="1"; shift ;;
    --json)         OCE_JSON_MODE="1"; shift ;;
    --dry-run)      OCE_DRY_RUN="1"; shift ;;
    -h|--help)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The script exposes a user-controlled --no-validate flag that disables the post-write validation and rollback safeguard before persisting edits. In an agentic code-editing tool, this weakens an important safety boundary and can be abused to force unsafe or malformed changes into source files, increasing the chance of code corruption or insertion of malicious content without detection.

Content

Scanner excerpt · scripts/oce-replace.sh (reported line 23)May include surrounding context.

sh
--all)         REPLACE_ALL="1"; shift ;;
    --count)       EXPECTED_COUNT="$2"; shift 2 ;;
    --txn)         TXN="$2"; shift 2 ;;
    --no-validate) SKIP_VALIDATE="1"; shift ;;
    --json)        OCE_JSON_MODE="1"; shift ;;
    --dry-run)     OCE_DRY_RUN="1"; shift ;;
    -h|--help)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

Documenting --no-validate in the help text confirms and advertises the availability of a validation-bypass option to any caller. In the context of a coding agent skill that performs persistent file modifications, making this bypass discoverable increases the likelihood that downstream users or prompt-influenced agents invoke it to suppress safety checks.

Content

Scanner excerpt · scripts/oce-replace.sh (reported line 37)May include surrounding context.

sh
--all                        Replace every occurrence
  --count N                    Assert exactly N matches will be replaced
  --txn ID                     Register backup with a transaction
  --no-validate                Skip post-write syntax validation
  --dry-run                    Show match count and proposed change, do nothing
EOF
      exit 0 ;;

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The script exposes a user-controlled --no-validate flag that disables the post-write validation step, undermining the core safety guarantee advertised by the tool. In an agentic coding context, this is especially risky because an LLM agent or upstream caller could be induced to use this option and persist invalid or unsafe file changes without rollback.

Content

Scanner excerpt · scripts/oce-write.sh (reported line 14)May include surrounding context.

sh
while [ $# -gt 0 ]; do
  case "$1" in
    --no-validate)  SKIP_VALIDATE="1"; shift ;;
    --txn)          TXN="$2"; shift 2 ;;
    --new)          FORCE_NEW="1"; shift ;;
    --json)         OCE_JSON_MODE="1"; shift ;;

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 · scripts/oce-write.sh (reported line 26)May include surrounding context.

sh
Auto-backs-up before writing. Validates after. Rolls back if invalid.

  --new           Require the file to NOT already exist
  --no-validate   Skip post-write validation (rare; use cautiously)
  --txn ID        Register backup with a transaction
  --dry-run       Print what would happen, change nothing
EOF

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill explicitly instructs the agent to invoke shell commands (bash <skill-path>/scripts/oce.sh, alias creation, installer execution) but does not declare any tool scope such as permissions or allowed-tools. That creates an authorization gap where a broadly-triggered skill can induce shell execution without an explicit capability boundary, increasing the chance of unintended command execution in sensitive contexts.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 7)May include surrounding context.

json
"description": "CLI code-editing toolkit for agentic coders. Provides the oce command.",
  "private": true,
  "dependencies": {
    "acorn": "^8.11.0",
    "js-yaml": "^4.1.0"
  }
}

Unverifiable Dependency: acorn has 1 known advisory(ies) (GHSA-6chw-6frg-f759 (Regular Expression Denial of Service in Acorn)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Content

Scanner excerpt · package.json (reported line 8)May include surrounding context.

json
"private": true,
  "dependencies": {
    "acorn": "^8.11.0",
    "js-yaml": "^4.1.0"
  }
}

Unverifiable Dependency: js-yaml has 11 known advisory(ies) (CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); GHSA-2pr6-76vf-7546 (Denial of Service in js-yaml); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption) +8 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This script creates a backup and then overwrites the target file in place via fs.writeFileSync, but the non-help execution path does not emit any user-facing notice before performing the write. Although the script's purpose is insertion and it reports success afterward, there is no pre-action disclosure, confirmation prompt, or inline warning comment near the write path itself.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.