Back to skill

Security audit

Elasticsearch

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Elasticsearch operations skill with scoped local preferences and no evidence of hidden code execution or malicious behavior.

Install only if you want an agent to help with Elasticsearch operations. Review generated cluster-changing requests before running them, especially deletes, reindexing, alias swaps, force merges, and cluster settings. Keep real credentials out of examples and out of the skill memory/config files under ~/Clawic/data/elasticsearch/.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
| deployment | self-managed \| elastic-cloud \| serverless \| aws-opensearch \| opensearch-self-managed | self-managed | Which node, shard, and JVM settings are reachable at all; serverless and managed offerings hide most of `cluster.md`, and the OpenSearch values switch API names and drop ES-only features (→ `upgrades.md`) |
| major_version | 7 \| 8 \| 9 | 8 | Which version-gated advice applies when the live version is unknown, and what the upgrade path looks like |
| license_tier | basic \| gold \| platinum \| enterprise | basic | Suppresses recommendations behind a paid tier (ML and ELSER, document/field-level security, searchable snapshots, cross-cluster replication, Watcher alerting, audit logging) |
| client | dev-tools \| curl \| python \| javascript \| java \| go | dev-tools | The dialect every emitted request is written in (default: raw REST as shown throughout), and which row of the per-client retry, timeout, and bulk-helper branch in `clients.md` applies |
| target_shard_size_gb | number (10-50) | 40 | The divisor in the shard-count formula (Core Rules 4) and the `max_primary_shard_size` rollover condition |
| bulk_batch_mb | number (1-20) | 10 | Starting payload size per `_bulk` request (Core Rules 6) and the batch size in reindex and ingest recipes |
| default_replicas | number (0-2) | 1 | `number_of_replicas` in emitted index templates; 0 is correct for a single-node dev cluster, which otherwise sits yellow forever |

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 · search-performance.md (reported line 39)May include surrounding context.

md
- **`from`/`size`** — each shard sorts and returns `from + size` hits to the coordinator, which merges and discards. Bounded by `index.max_result_window` (default 10,000). Correct for the first few pages, and only those.
- **`search_after`** — pass the previous page's `sort` values as the cursor. Constant cost per page regardless of depth. Requires a **unique, total** sort: append `_shard_doc` (added automatically with a PIT) or `_id` as the tiebreak, or pages will skip and repeat documents.
- **Point in time** — `POST /<index>/_pit?keep_alive=5m` returns an ID that freezes the segment view. Pass it instead of an index name so a concurrent refresh cannot shift the result set mid-pagination. **Close it** (`DELETE /_pit`) when done: an open PIT pins segments, and pinned segments cannot be merged away, so leaked PITs quietly grow disk usage.
- **`scroll`** — legacy. Holds a context per scroll, capped by `search.max_open_scroll_context` (default 500), and `search_context_missing_exception` is what a leaked or expired one looks like. Use PIT + `search_after` for everything new.
- **Exports** — PIT + `search_after` with `size: 5000` and a `_shard_doc` sort, or `_reindex` into a scratch index when the destination is Elasticsearch anyway.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This section instructs readers on running reindex operations, including creating destination indexes and later performing an alias swap, but it does not include any explicit caution that these actions modify cluster data and can affect production traffic if misapplied. For markdown files, the guidance should warn about behaviors that could affect user data or system integrity when describing impactful operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The ingest pipeline example uses a remove processor to delete fields such as message and timestamp, which can permanently alter or discard original data at write time. The surrounding text does not warn users about this data-loss tradeoff or recommend preserving raw fields when needed for audit or troubleshooting.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · errors.md (reported line 65)May include surrounding context.

md
|---|---|---|
| `security_exception: missing authentication credentials` | No credentials, or the client dropped them on a redirect | API key or basic auth on every request |
| `security_exception: action [indices:data/read/search] is unauthorized for user [x] on indices [y]` | Role lacks the privilege or the index pattern | Read the action name in the message — it maps directly to a privilege |
| `SSLHandshakeException: PKIX path building failed` | Client does not trust the cluster's CA | Supply the CA certificate or fingerprint; do not disable verification |
| `Received plaintext http traffic on an https channel` | Client using `http://` against a TLS-enabled cluster | `elasticsearch >=8.0` enables TLS by default |
| `current license is non-compliant for [x]` | Feature above the licensed tier | `license_tier` variable; choose the open-tier alternative |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs the agent to read from and write to user-local files containing preferences and prior context without any explicit notice, consent, or access boundary in the skill itself. That creates a privacy and prompt-scope risk: the agent may ingest unrelated sensitive local data and persist new information across sessions, which can surprise users and leak or retain data beyond the immediate task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example shows inline username and password fields in a request body and does not warn readers against hardcoding or exposing secrets. In documentation for operating production Elasticsearch clusters, this can normalize insecure secret handling and lead users to copy credentials into code, shell history, notebooks, or shared docs, increasing the risk of credential leakage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The document instructs readers to close an index, change analyzers, reopen it, and reindex existing documents. Those actions can affect search availability and existing data state, but the markdown provides no explicit caution or warning banner about operational impact.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.