Back to skill

Security audit

Ambari API

Security checks for vulnerabilities and agentic risk

Overview

This skill is a legitimate Ambari cluster-management tool, but it handles privileged credentials and live service changes with unsafe defaults that users should review before installing.

Review carefully before installing, especially for production clusters. Use a least-privilege Ambari account, avoid real passwords on the command line, do not rely on the plaintext config file for sensitive credentials, enable certificate verification or a trusted CA path before use, and treat stop/restart commands as outage-causing administrative actions.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ambari_api.py:35
Finding
TLS Certificate Verification Disabled by Default<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ambari_api.py:14, 35-38, 53-60` **Vulnerability Type**: Improper certificate validation **Risk Level**: High ### Vulnerable Code ```python urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ``` ```python def __init__(self, base_url, username, password, verify_ssl=False): self.base_url = base_url.rstrip('/') self.auth = HTTPBasicAuth(username, password) self.verify_ssl = verify_ssl ``` ```python response = self.session.request( method=method, url=url, auth=self.auth, json=data, params=params, verify=self.verify_ssl ) ``` ### Technical Analysis The client disables TLS certificate verification by default through `verify_ssl=False` and suppresses the corresponding `InsecureRequestWarning`. Every client created by the command-line interface uses this insecure default because no CLI or configuration option is provided to enable certificate verification. Consequently, the client does not verify that it is communicating with the intended Ambari server. HTTP Basic Authentication credentials are transmitted with each request and are protected only by the unverified TLS connection. An attacker able to intercept network traffic can present an arbitrary certificate without causing the connection to fail. The warning suppression further reduces the likelihood that an operator will notice the insecure connection. ### Attack Path 1. An operator configures an HTTPS Ambari endpoint and invokes a cluster-management command. 2. An attacker obtains a network interception position, such as through a compromised gateway, malicious proxy, DNS poisoning, or hostile wireless network. 3. The attacker redirects or intercepts the connection and presents an attacker-controlled TLS certificate. 4. The client accepts the certificate because `verify=False` is used. 5. The client sends the Ambari username and password using HTTP Basic Authentication. 6. The attacker cap ...[truncated 650 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change the constructor default to `verify_ssl=True`. 2. Remove the global suppression of `InsecureRequestWarning`. 3. Add support for a trusted CA bundle through a CLI option or configuration field. 4. Permit insecure TLS only through an explicit option such as `--insecure`, accompanied by a prominent warning. 5. Reject plain HTTP endpoints by default, especially when privileged credentials are used. 6. Consider implementing the constructor as follows: ```python def __init__(self, base_url, username, password, verify_ssl=True): self.base_url = base_url.rstrip('/') self.auth = HTTPBasicAuth(username, password) self.verify_ssl = verify_ssl ``` 7. Add automated tests confirming that self-signed or untrusted certificates are rejected unless insecure mode is explicitly requested. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ambari_api.py:26
Finding
Ambari Credentials Stored in a Plaintext Configuration File<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ambari_api.py:16, 26-30, 205-210` **Vulnerability Type**: Plaintext storage of sensitive information with insufficient permission enforcement **Risk Level**: High ### Vulnerable Code ```python CONFIG_FILE = os.path.expanduser("~/.claude/skills/ambari-api/config.json") ``` ```python def save_config(config): """Save cluster configurations to config file""" os.makedirs(os.path.dirname(CONFIG_FILE), exist_ok=True) with open(CONFIG_FILE, 'w') as f: json.dump(config, f, indent=2) ``` ```python config['clusters'][args.name] = { 'url': args.url, 'username': args.username, 'password': args.password } save_config(config) ``` ### Technical Analysis The application saves Ambari usernames and passwords verbatim in a JSON file. It does not use an operating-system keyring, secret manager, encryption mechanism, or token-based credential provider. The file is opened with the normal Python `open(..., 'w')` behavior. Its effective permissions therefore depend on the process umask and on the permissions of any pre-existing file. The application neither creates the file explicitly with owner-only mode nor validates and repairs its permissions before reading or writing it. Although the file resides under the user's home directory, that placement alone does not guarantee that other local users, processes, backup systems, or tools can never read it. ### Attack Path 1. An operator adds an Ambari configuration using `config --add`. 2. The program serializes the supplied password into `config.json` as plaintext. 3. The file is created with permissions derived from the current umask, or an existing file retains unsafe permissions. 4. A local attacker, compromised process, backup collector, or unrelated tool with read access obtains the file. 5. The attacker extracts the Ambari URL, username, and password. 6. The attacker authenticates directly to the Ambari REST API. 7. The attacker p ...[truncated 496 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Store passwords in an operating-system keyring, enterprise secret manager, or another purpose-built credential store. 2. Save only a secret identifier in `config.json`, rather than the secret itself. 3. Where file storage is unavoidable, create the file atomically with mode `0600`. 4. Validate that the configuration directory is owned by the current user and is not writable by other users. 5. Check the permissions and ownership of an existing configuration file before loading it; reject or repair insecure permissions. 6. Avoid writing secrets through a predictable temporary file during atomic updates. 7. Support short-lived tokens or environment-specific credential providers where Ambari deployment options permit them. 8. Document credential rotation procedures for users migrating from the existing plaintext format. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ambari_api.py:319
Finding
Password Accepted and Documented as a Command-Line Argument<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ambari_api.py:319-327`; documented usage at `SKILL.md:16-20` and `references/examples.md:5-18` **Vulnerability Type**: Exposure of sensitive information through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```python config_parser = subparsers.add_parser('config', help='Manage cluster configurations') config_parser.add_argument('--list', action='store_true', help='List configured clusters') config_parser.add_argument('--add', action='store_true', help='Add a cluster config') config_parser.add_argument('--remove', action='store_true', help='Remove a cluster config') config_parser.add_argument('--name', help='Cluster config name') config_parser.add_argument('--url', help='Ambari server URL (e.g., https://ambari:8080)') config_parser.add_argument('--username', help='Ambari username') config_parser.add_argument('--password', help='Ambari password') ``` The documented invocation reinforces the unsafe behavior: ```bash python ~/.claude/skills/ambari-api/scripts/ambari_api.py config --add \ --name prod \ --url https://ambari.example.com:8080 \ --username admin \ --password admin ``` ### Technical Analysis Passwords supplied as command-line arguments can be exposed outside the target process. Depending on the operating system and environment, arguments may be visible through process-listing tools, process metadata, audit logs, shell tracing, terminal recording, command history, automation logs, or Agent transcripts. The primary documentation explicitly instructs users to place a literal password after `--password`, making accidental disclosure the expected usage pattern rather than an exceptional fallback. ### Attack Path 1. An operator follows the documentation and supplies an Ambari password through `--password`. 2. The shell records the complete command in its history, or the operating system exposes the command line while the process is running. 3. A lo ...[truncated 654 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prompt interactively using `getpass.getpass()` when a password is required. 2. Replace direct password arguments with secret references, keyring entries, or protected file descriptors. 3. If non-interactive operation is necessary, support a secret manager integration rather than a plaintext CLI value. 4. Remove literal passwords from all examples and documentation. 5. Warn users that previously entered commands may remain in shell history and should be removed securely. 6. Avoid using ordinary environment variables as the primary solution because they can also be exposed in diagnostics and process environments. 7. Deprecate `--password` and, if temporarily retained for compatibility, emit a prominent security warning before removing it in a later release. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding
Runtime Dependencies Use Open-Ended Version Constraints Without Integrity Pinning<![CDATA[ ## Vulnerability Details **File Location**: `scripts/requirements.txt:1-2`; installation instruction at `SKILL.md:12-13` **Vulnerability Type**: Non-reproducible dependency resolution and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```text requests>=2.28.0 urllib3>=1.26.0 ``` The documented installation command resolves these ranges at installation time: ```bash pip install -r ~/.claude/skills/ambari-api/scripts/requirements.txt ``` ### Technical Analysis The dependencies use lower bounds without upper bounds, exact version pins, lock-file resolution, or cryptographic hashes. Each installation may therefore retrieve a different future version that was not reviewed with this project. The package names shown are legitimate and the audited files do not specify a suspicious package source. Nevertheless, the dependency policy leaves the installation process exposed to compromised future releases, unexpected compatibility changes, and package-index or resolution attacks. The absence of hashes also prevents pip from verifying that an artifact is the exact artifact approved by the project. ### Attack Path 1. A user runs the documented `pip install` command. 2. Pip resolves the newest versions satisfying the open-ended constraints. 3. A future dependency release, package-index artifact, or transitive dependency is compromised or behaves incompatibly. 4. Pip downloads and installs the unreviewed artifact. 5. Package installation code or imported runtime code executes with the privileges of the user performing the installation or running the Skill. 6. The compromised dependency can access the same files, credentials, and network resources available to that process. ### Impact Assessment The potential impact is bounded by the privileges of the installing or executing user. Those privileges may include access to the plaintext Ambari configuration, the user's files, and network access to cluster-management endpoints. No currently m ...[truncated 159 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin dependencies to versions reviewed and tested by the project. 2. Generate a lock file that includes resolved transitive dependencies. 3. Require cryptographic hashes for downloaded artifacts, such as through pip's `--require-hashes` mode. 4. Install only from an explicitly trusted package index. 5. Review dependency updates through a controlled process with automated vulnerability scanning and compatibility tests. 6. Regenerate pins and hashes whenever an approved dependency update is released. 7. Consider using a tool such as `pip-tools` to maintain a human-readable source requirements file and a fully resolved, hashed installation file. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented purpose understates and inconsistently describes the skill’s behavior, including local credential storage and host-level operations beyond the stated management scope. Description-behavior mismatches are dangerous because users and orchestration systems may invoke the skill under false assumptions, leading to sensitive credential exposure or broader-than-expected administrative actions on cluster infrastructure.

Missing User Warnings

High
Confidence
98% confidence
Finding
The file shows plaintext credentials on the command line for both development and production examples without warning that shell arguments are exposed via history, process listings, terminal logging, and operational runbooks. In the context of an Ambari administration tool, this is especially dangerous because the credentials are for privileged cluster management, making accidental disclosure likely and high-value to an attacker.

Missing User Warnings

High
Confidence
98% confidence
Finding
The client sends HTTP Basic Auth credentials while TLS certificate verification is disabled by default and related warnings are suppressed. In the context of cluster administration, this enables man-in-the-middle interception or tampering of credentials and management commands, potentially allowing an attacker to take over or disrupt Hadoop services.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill documents commands that read and write local files and perform network operations against Ambari, but it declares no explicit tool scope or permission boundaries. This increases the chance that an agent or reviewer will underestimate the skill’s real capabilities, enabling unintended file access, credential handling, or cluster changes without clear policy constraints.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The activation text uses broad triggers such as mentions of Ambari, HDP, HDF, or cluster operations without clear guardrails. Over-broad activation can cause the skill to be selected in contexts where the user did not intend administrative actions, increasing the risk of unnecessary credential prompts, information disclosure, or destructive API calls.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The quick-start instructions tell users to supply and store Ambari credentials, including a password, without any warning about sensitive data handling or storage protections. Because this skill manages administrative cluster access, unsafe credential storage can directly enable unauthorized control over services, hosts, and operational state.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation presents stop and restart operations as routine commands without warning about operational impact, downtime, or the need for explicit confirmation. In the context of production cluster administration, these are highly sensitive actions that can interrupt storage, scheduling, or query services across a Hadoop environment.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This markdown file documents a PUT endpoint that changes service state, including starting and stopping cluster services, but provides no warning that these actions can affect availability or production workloads. Under the markdown-specific missing-warning rule, operational changes that can impact system integrity should be accompanied by a user-facing caution.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The file includes a PUT endpoint for changing host component state, such as starting a DATANODE on a host, but does not warn users that this performs live infrastructure changes. Markdown guidance for such actions should disclose potential effects on service health, availability, and system integrity.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The documentation includes production-labeled Ambari configuration examples with plaintext usernames and passwords, which normalizes unsafe secret handling and can lead users to paste real credentials into shell history, CI logs, screenshots, or shared docs. In an infrastructure-management skill, admin credentials grant broad operational control, so even example secrets in a production context materially increase the chance of credential exposure and misuse.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The examples instruct users to stop and restart production services without any warning, confirmation, rollback guidance, or discussion of availability impact. In a cluster-operations skill, such commands are inherently disruptive and can cause outages or data-processing failures if run casually or in the wrong environment.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The Python example hardcodes administrator credentials directly in source, encouraging copy-paste into scripts, notebooks, and repositories where secrets are often retained indefinitely. Because this skill manages Ambari clusters, those credentials could enable unauthorized service operations, cluster reconfiguration, or broader compromise of Hadoop environments if replaced with real values.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The troubleshooting guidance explicitly recommends trying the default Ambari credentials `admin/admin` without any warning or restriction. In a cluster-management skill, this normalizes insecure authentication practices and could lead users to attempt or retain well-known credentials on privileged infrastructure, increasing the chance of unauthorized administrative access.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
Suggesting default credentials as a normal troubleshooting step is unsafe because Ambari provides administrative control over Hadoop clusters and their services. In this context, encouraging use of a known default username/password pair materially increases risk by enabling weak-authentication behavior on production-like systems.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
class AmbariClient:
    """Ambari REST API Client"""

    def __init__(self, base_url, username, password, verify_ssl=False):
        self.base_url = base_url.rstrip('/')
        self.auth = HTTPBasicAuth(username, password)
        self.verify_ssl = verify_ssl
Confidence
99% confidence
Finding
The unsafe default verify_ssl=False makes insecure transport the standard behavior for all API interactions unless a caller overrides it, and this file never exposes a safe way to do so through configuration. Because this skill manages Ambari cluster operations with administrative credentials, the insecure default materially increases the likelihood of credential theft and command tampering.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The `service_action` docstring says supported actions include `INSTALLED (same as STOP)`, yet the `valid_actions` list excludes `INSTALLED` and the function rejects it. This creates a direct contradiction between the function's documentation and its runtime behavior.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill stores Ambari credentials in plaintext in a local JSON config file under the user's home directory without setting restrictive file permissions or warning the user. On multi-user systems, backups, endpoint collection tools, or compromised user sessions, these credentials could be exposed and then used to administer Hadoop cluster services.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The CLI parser documents and accepts `INSTALL` as a valid component action, but `component_action` only allows `START` and `STOP` and returns an invalid-action error for `INSTALL`. This is an active contradiction between the exposed command interface/documentation and the code's actual behavior.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.28.0
urllib3>=1.26.0
Confidence
96% confidence
Finding
The dependency is specified with a lower bound only (`requests>=2.28.0`), so builds may resolve to different versions over time and could inadvertently install a release with known vulnerabilities or breaking behavior. In a cluster-management skill that makes outbound API calls to Ambari, dependency drift in an HTTP client increases supply-chain and runtime risk, even though this file alone does not prove a currently vulnerable version is installed.

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding
`requests` has multiple known advisories, and because the manifest does not pin the version, there is no way to verify from this file whether deployments avoid affected releases. In a skill that performs authenticated REST operations against Ambari, an affected HTTP client could expose credentials, weaken TLS/request handling, or mishandle redirects depending on the resolved version.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.28.0
urllib3>=1.26.0
Confidence
96% confidence
Finding
The dependency is unpinned (`urllib3>=1.26.0`), which makes installations non-reproducible and can result in pulling a vulnerable or incompatible version in the future. Because this skill manages Hadoop clusters over REST, the HTTP transport library is security-relevant and version ambiguity makes safe deployment harder to verify.

Unverifiable Dependency: urllib3 has 16 known advisory(ies) (CVE-2025-66471 (urllib3 streaming API improperly handles highly compressed data); CVE-2024-37891 (urllib3's Proxy-Authorization request header isn't stripped during cross-origin ); CVE-2026-21441 (Decompression-bomb safeguards bypassed when following HTTP redirects (streaming ) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding
`urllib3` has known advisories, but the unpinned requirement prevents determining whether installed environments are exposed. Since `urllib3` underpins HTTP communication and may process redirects, proxies, and compressed responses, this uncertainty is more concerning in a cluster-management tool that interacts with potentially sensitive infrastructure endpoints.

Static analysis

No suspicious patterns detected.