Back to skill

Security audit

Kibana Data Views

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly about Kibana data views, but it includes environment-specific destructive cleanup scripts and a hardcoded Elasticsearch admin credential that need review before installation.

Review this skill before installing. It should only be used in a controlled Kibana/Elasticsearch environment after removing or rotating the exposed credential, replacing HTTP/auth examples with approved secret handling, requiring explicit confirmation for deletes and cleanup, and narrowing scripts to user-selected data views and hosts.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:199
Finding
Hardcoded Elasticsearch Administrative Credential in Documentation## Vulnerability Details **File Location**: `SKILL.md`, lines 199–204 **Vulnerability Type**: Hardcoded administrative credential **Risk Level**: High **Complete Code Snippet**: ```bash 4. **Check .kibana index health:** ```bash # Query from within k8s cluster kubectl exec -n elastic elasticsearch-0 -- curl -s -u 'elastic:Changeme123' \ 'http://localhost:9200/.kibana/_search?size=100' \ -H 'Content-Type: application/json' \ -d '{"query": {"prefix": {"type": "index-pattern"}}}' ``` ``` ### Technical Analysis The Skill embeds the Basic Authentication credential `elastic:Changeme123` in an executable troubleshooting command. The `elastic` user is conventionally an Elasticsearch superuser, so this credential may provide substantially more privileges than are required merely to inspect Kibana index-pattern records. Any person or process able to read the project can recover the credential. If the documented command is executed, the secret may also be retained in shell history or temporarily exposed through process-argument inspection. The request uses HTTP, although it targets the pod-local interface in this example. ### Attack Path 1. An attacker obtains read access to the Skill package or its documentation. 2. The attacker extracts the username and password from `SKILL.md`. 3. The attacker obtains network access to Elasticsearch or permission to execute commands in the named Kubernetes pod. 4. The attacker authenticates using the exposed `elastic` credential. 5. If the credential remains valid and retains its expected privileges, the attacker queries, modifies, or deletes resources available to that account. Exploitation depends on the credential being valid and the attacker having a reachable path to Elasticsearch. ### Impact Assessment If valid, the credential may grant Elasticsearch superuser privileges rather than read-only access to `.kibana`. The potential scope includes disclosure or modifica ...[truncated 285 chars]
Remediation
## Remediation Suggestions 1. Remove the username and password from `SKILL.md` and all repository history where practical. 2. Immediately rotate the credential if it has ever been valid. 3. Replace the superuser with a dedicated, least-privileged service account that has only the read permissions required for the diagnostic query. 4. Store credentials in Kubernetes Secrets or an approved secret manager and inject them at runtime. 5. Avoid passing passwords directly through command-line arguments. Use a protected credential file, environment-based secret injection where appropriate, or another mechanism supported by the organization’s secret-management controls. 6. Use HTTPS with certificate verification for non-local Elasticsearch and Kibana communication. 7. Add automated secret scanning to pre-commit and CI pipelines to prevent future credential commits. 8. Review access logs for use of the exposed account and investigate unexpected authentication or administrative activity.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
The declared description presents a general-purpose Kibana Data View management capability covering create, list, get-by-ID, update, and delete operations. The supplied code only implements listing all data views and creating missing ones from a predefined list, primarily as a diagnostic/fix tool for one project. That means the actual behavior is narrower and more specialized than declared. While checking existence and troubleshooting missing index patterns are consistent with the description, the claimed broader CRUD-style management functionality is not fully represented by this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The description presents a general-purpose skill for managing Kibana Data Views across standard CRUD-style REST endpoints, explicitly including update (PUT /api/data_views/{viewId}). The supplied code is narrower and materially different in purpose: it is a specialized maintenance script that cleans up corrupt/orphaned and duplicate data views and then recreates a hard-coded set of Omni-Monitor data views. This is not a general data-view management implementation; it performs destructive bulk remediation against a specific Kibana instance and predefined titles. Additionally, while the declared description includes update capability, the code never performs PUT/update operations. Because the actual code’s primary purpose is specialized cleanup/recreation rather than general API management, this is a description-behavior mismatch.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
---
name: kibana-data-views
description: "Manage Kibana Data Views (formerly index patterns) via REST API. Use when: (1) Creating, listing, updating, or deleting data views, (2) Checking data view existence before dashboard creation, (3) Troubleshooting missing index patterns, (4) Programmatically managing Kibana index patterns. API endpoints: POST /api/data_views, GET /api/data_views, GET /api/data_views/{viewId}, PUT /api/data_views/{viewId}, DELETE /api/data_views/{viewId}."
---

# Kibana Data Views API Skill
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).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 5. Delete a Data View
```
DELETE /api/data_views/{viewId}
```

**Headers:**
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).

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
Including kubectl pod execution and direct Elasticsearch access gives the skill capabilities far beyond Kibana data view management. In context, this can expose sensitive cluster data, credentials, and administrative surfaces, making misuse significantly more dangerous than the stated purpose suggests.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill describes network-capable operations against Kibana and related services but does not declare any explicit tool scope or allowed-tools constraints. In an agent environment, undocumented network capability increases the chance of unintended outbound access and makes it harder to enforce least privilege.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The authentication guidance recommends session cookies or Basic auth while the examples use plain HTTP, without warning that credentials can be exposed in transit. This is especially dangerous because the skill also includes a concrete internal IP address, encouraging direct use in a likely real environment.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill documents deletion of data views without warning about irreversible operational impact, such as broken dashboards or loss of references. In agent-assisted environments, omission of destructive-action warnings increases the chance of unsafe execution based on ambiguous prompts.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
Documenting Kibana's generic console proxy introduces a broader request-forwarding mechanism than the skill's declared data-view scope. A generic proxy can be repurposed to reach other Kibana or backend paths, undermining endpoint-level restrictions and enabling unexpected access paths.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The generic console proxy is a broader request primitive than necessary for managing data views and can enable access to unintended APIs. Within an agent skill, such an overbroad mechanism weakens least-privilege guarantees and makes policy enforcement harder.

External Transmission

Medium
Category
Data Exfiltration
Content
1. **Check if data view exists:**
```bash
curl -s "http://192.168.99.43/api/data_views" \
  -H "kbn-xsrf: true"
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill expands from Kibana data view management into direct Elasticsearch .kibana index inspection via kubectl exec inside the cluster. That materially broadens access from a narrow application API to cluster-internal administrative operations, increasing the blast radius if the skill is used by an agent or user beyond its intended scope.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The script performs bulk cleanup and recreation of Kibana data views across the target instance, which is substantially broader than scoped, on-demand CRUD management described by the skill. In an agent setting, this creates a dangerous mismatch between expected capability and actual behavior, allowing widespread destructive changes to dashboards and saved objects that depend on those data views.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The hard-coded Omni-Monitor catalog and default Kibana endpoint embed environment-specific provisioning behavior into a supposedly general-purpose management skill. This increases the chance of accidental modification of the wrong Kibana instance and unauthorized creation of data views unrelated to the user's request, especially if the script is invoked with defaults.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script deletes Kibana data views immediately in live mode without any confirmation, approval gate, or strong targeting constraints. In an automation or agent context, this materially raises the risk of accidental destructive actions, causing loss of data-view references and breaking dashboards, searches, and operational workflows.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This script performs an irreversible DELETE request against the Kibana Data Views API immediately from command-line input, with no confirmation prompt, dry-run mode, or explicit safeguard against accidental execution. In the context of an admin automation skill for managing data views, that increases the risk of operator error or misuse, which can disrupt dashboards and saved objects that depend on the deleted data view.

Intent-Code Divergence

Low
Confidence
84% confidence
Finding
The module docstring states the script cleans up corrupted/orphaned data views that appear in listings but 404 on GET. In the duplicate-handling logic, only the first data view for a title is checked for accessibility, while other same-title entries are treated as duplicates rather than individually validated, so the implementation does not fully match the stated cleanup intent.

Intent-Code Divergence

Low
Confidence
90% confidence
Finding
The code comment states that the API returns "data_view" (singular) as the array key, and the code accordingly reads `data.get("data_view", [])`. For the manifest-described listing endpoint `GET /api/data_views`, the expected response is a collection of data views, so this comment and parsing intent are inconsistent with the endpoint's documented behavior and may cause the script to mis-handle the response.

Static analysis

No suspicious patterns detected.