Back to skill

Security audit

dxyz-cPanel

Security checks for vulnerabilities and agentic risk

Overview

This is a real cPanel administration skill, but it gives an agent powerful hosting-control commands with weak safeguards and insecure credential handling.

Review this skill before installing it on any real hosting environment. Use only narrowly scoped, revocable API tokens; prefer environment or secret-manager storage over the documented plaintext config file; require explicit human confirmation for account deletion, DNS deletion, database deletion, and restore operations; and avoid the helper scripts until their URL encoding, HTTPS enforcement, and create_account.sh sourcing bug are fixed.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (7)

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/create_account.sh:7
Finding

Executable API Client Is Sourced, Enabling Unintended Privileged API Dispatch

Content
View full analysis
/dev/null || true HOST="${CPANEL_HOST:?CPANEL_HOST not set}" TOKEN="${CPANEL_TOKEN:?CPANEL_TOKEN not set}" ``` ```bash # scripts/cpanel_api.sh:28-59 API_TYPE="${1:-whm}" ENDPOINT="${2}" shift 2 2>/dev/null || true PARAMS="$@" # Build URL and auth header case "$API_TYPE" in whm) URL="${HOST}/json-api/${ENDPOINT}" AUTH_HEADER="Authorization: whm ${TOKEN}" ;; uapi) URL="${HOST}/execute/${ENDPOINT}" AUTH_HEADER="Authorization: cpanel ${TOKEN}" ;; cpanel2) URL="${HOST}/json-api/cpanel2" AUTH_HEADER="Authorization: cpanel ${TOKEN}" ;; *) echo "Error: Invalid API type. Use: whm, uapi, or cpanel2" exit 1 ;; esac # Append params if [[ -n "$PARAMS" ]]; then URL="${URL}?${PARAMS}" fi # Make request RESPONSE=$(curl -s -w "\n%{http_code}" -H "$AUTH_HEADER" "$URL") ``` ### Technical Analysis `cpanel_api.sh` is a complete executable program with top-level argument parsing, control flow, network activity, and `exit` calls. It is not a source-only configuration library. When `create_account.sh` sources it, the sourced program inherits the positional arguments originally supplied to `create_account.sh`. Consequently, the intended account username becomes `API_TYPE`, the domain becomes `ENDPOINT`, and the password and plan become raw query-string parameters. Normal usernames usually make the sourced script terminate with an invalid API-type error. More importantly, arguments beginning wit ...[truncated 1289 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create_account.sh:21
Finding

Passwords and TLS Private Keys Are Transmitted in URL Query Strings

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cpanel_api.sh:28
Finding

Unencoded Arguments Permit API Query-Parameter Injection

Content
View full analysis
/dev/null || true PARAMS="$@" ``` ```bash # scripts/cpanel_api.sh:53-59 # Append params if [[ -n "$PARAMS" ]]; then URL="${URL}?${PARAMS}" fi # Make request RESPONSE=$(curl -s -w "\n%{http_code}" -H "$AUTH_HEADER" "$URL") ``` ```bash # scripts/manage_dns.sh:21-29 add) NAME="${3:?Record name required}" TYPE="${4:?Record type required (A, AAAA, CNAME, MX, TXT)}" VALUE="${5:?Record value required}" TTL="${6:-3600}" echo "Adding $TYPE record: $NAME -> $VALUE..." curl -s -H "Authorization: cpanel $TOKEN" \ "${HOST}/execute/DNS/add_zone_record?domain=${DOMAIN}&name=${NAME}&type=${TYPE}&address=${VALUE}&ttl=${TTL}" | jq . ;; ``` ### Technical Analysis Arguments are concatenated directly into URLs without per-field URL encoding or strict validation. Characters such as `&` and `=` retain query-string semantics. An attacker-controlled value can therefore terminate one parameter and introduce additional parameters. Shell quoting prevents shell command injection in these examples, but it does not prevent HTTP parameter injection. The generic API wrapper is especially risky because it treats the remaining arguments as a raw query string and permits the endpoint to be supplied dynamically. ### Attack Path 1. An attacker controls or influences a domain, username, record value, destination address, database name, restore filename, or generic helper parameter. 2. The attacker includes query delimiters such as `¶meter=value`. 3. The script concatenates the value into the authenticated API URL. 4. cPanel parses ...[truncated 752 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cpanel_api.sh:9
Finding

Administrative Tokens Can Be Sent Over Plaintext HTTP

Content
View full analysis
/dev/null || echo "$HOST") TOKEN=$(jq -r '.token // empty' "$CONFIG_FILE" 2>/dev/null || echo "$TOKEN") fi # Validate if [[ -z "$HOST" || -z "$TOKEN" ]]; then echo "Error: CPANEL_HOST and CPANEL_TOKEN must be set" echo "Set environment variables or create $CONFIG_FILE" exit 1 fi ``` ```bash # scripts/cpanel_api.sh:33-59 case "$API_TYPE" in whm) URL="${HOST}/json-api/${ENDPOINT}" AUTH_HEADER="Authorization: whm ${TOKEN}" ;; uapi) URL="${HOST}/execute/${ENDPOINT}" AUTH_HEADER="Authorization: cpanel ${TOKEN}" ;; cpanel2) URL="${HOST}/json-api/cpanel2" AUTH_HEADER="Authorization: cpanel ${TOKEN}" ;; esac RESPONSE=$(curl -s -w "\n%{http_code}" -H "$AUTH_HEADER" "$URL") ``` ### Technical Analysis The documentation recommends HTTPS, but the executable code only verifies that the host and token are nonempty. It accepts an `http://` host and then sends the bearer-style authorization header and potentially sensitive query parameters over an unencrypted connection. Because possession of the token grants its assigned API privileges, confidentiality of the authorization header is essential. A recommendation in documentation is not a security control. ### Attack Path 1. `CPANEL_HOST` or the config file is accidentally or maliciously set to an `http://` URL. 2. A helper script constructs a request using that host. 3. Curl transmits the authorization h ...[truncated 437 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup_account.sh:41
Finding

Backup Download Allows Overwriting an Arbitrary Writable Local File

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:193
Finding

Documentation Encourages Plaintext Storage of a Privileged API Token Without Permission Controls

Content
View full analysis
/dev/null || echo "$HOST") TOKEN=$(jq -r '.token // empty' "$CONFIG_FILE" 2>/dev/null || echo "$TOKEN") fi ``` ### Technical Analysis The instructions place a privileged API token in plaintext at a predictable filesystem location. They do not require restrictive directory or file permissions, and the reader does not verify ownership, mode, or whether the path is a regular non-symlink file. A later general recommendation to store tokens securely does not establish an enforceable protection for this documented configuration mechanism. ### Attack Path 1. A user creates `~/.cpanel/config.json` according to the documentation. 2. The user's umask or file-creation process leaves the file readable by other local users or services. 3. Another local process, backup collector, or accidentally published archive obtains the file. 4. The attacker extracts the token. 5. The token is reused against the configured cPanel/WHM server. ### Impact Assessment The attacker obtains every API permission assigned to the stored token. A root-level or broadly scoped WHM token can expose server administration, hosting accounts, DNS, backups, and other sensitive operations. ]]>
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:33
Finding

Manual Installation Uses an Unpinned Mutable Third-Party Repository

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (34)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a full-featured cPanel administration skill with many specific management capabilities. The supplied code chunk is much narrower: it is a generic API caller for WHM, UAPI, and cPanel API 2 that forwards an endpoint and parameters to curl using a token. While such a wrapper could support those operations indirectly if called with appropriate endpoints, this chunk itself does not implement those specific functions. Therefore the declared description materially overstates the actual behavior of the provided code. There is no evidence of unrelated malicious behavior, but there is a clear description-to-behavior mismatch in scope and implemented capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation includes account suspension and termination commands without requiring an explicit confirmation workflow, dry-run step, or warning. In a high-privilege hosting environment, an agent or operator could execute irreversible account-impacting actions too easily, causing service outage or data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script performs irreversible DNS record deletion immediately based on a user-supplied line number, with no confirmation prompt, dry-run mode, or validation guardrails. In an agent-integrated hosting administration skill, this increases the chance of accidental or misdirected destructive actions that can break domain resolution, email delivery, and service availability.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises destructive operations such as deleting accounts, DNS records, email resources, backups, and file actions without any safety notice, confirmation guidance, or warning about service interruption and irreversible data loss. In an administrative hosting context, this increases the chance of accidental misuse by an operator or downstream agent, which can lead to outages, data destruction, or restoration complications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation tells users to export a cPanel API token directly into environment variables without any accompanying guidance on secure storage, least privilege, rotation, or avoiding disclosure in logs and shell history. Because this token likely grants powerful administrative access to WHM/cPanel APIs, poor credential handling could enable full hosting-account compromise if the token is exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file describes capabilities such as terminating hosting accounts, deleting DNS records, deleting files, and restoring backups, all of which can affect user data or system integrity. The README does not include a clear warning or caution section near these operations explaining that they may be destructive or irreversible.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The README recommends storing the API token in a persistent config file under the user's home directory without any mention of file permissions, encryption, or secret handling. On multi-user systems, shared environments, backups, or compromised endpoints, this increases the chance of long-lived credential disclosure and subsequent full administrative access to cPanel/WHM.

Content

Scanner excerpt · README.md (reported line 50)May include surrounding context.

text

### Config File
Create `~/.cpanel/config.json`:
```json
{
  "host": "https://your-server.com:2087",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The quick-start examples embed passwords directly in shell commands and URLs, which can expose secrets through shell history, process listings, logs, and agent transcripts. In a skill designed to drive exec-based automation against real hosting infrastructure, users may copy these patterns verbatim into production workflows.

Content

No source excerpt is available for this finding.

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 · README.md (reported line 124)May include surrounding context.

md
# Generic API caller
exec command="bash ~/.picoclaw/workspace-default/skills/dxyz-cpanel/scripts/cpanel_api.sh listaccts"

# Create hosting account
exec command="bash ~/.picoclaw/workspace-default/skills/dxyz-cpanel/scripts/create_account.sh --user=myuser --domain=mydomain.com"

# Manage DNS records

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell-based exec commands extensively but does not declare a restrictive tool scope such as permissions or allowed-tools. In an agent environment, this increases the chance the skill is invoked with broader shell capability than necessary, enabling unintended command execution paths against administrative cPanel/WHM endpoints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description is broad enough to trigger the skill for generic server administration requests, even though it exposes high-privilege hosting-management actions. Over-broad routing in an agentic system can cause this skill to be selected in contexts where destructive or sensitive cPanel/WHM operations are not appropriate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The restore operation is documented without an explicit warning that it may overwrite, alter, or conflict with existing account data. In practice, restore actions can materially change a live hosting account and should not be presented as a routine command without safeguards.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 163)May include surrounding context.

md
The skill includes helper scripts:

- `scripts/cpanel_api.sh` - Generic API caller with error handling
- `scripts/create_account.sh` - Create hosting account
- `scripts/manage_dns.sh` - DNS zone management
- `scripts/manage_email.sh` - Email account operations
- `scripts/manage_database.sh` - MySQL/PostgreSQL operations

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file documents the removeacct endpoint as "Delete an account" and lists its parameters, but it does not warn that the action is destructive and potentially irreversible. Under the markdown-file criteria for SQP-2, descriptions should disclose behaviors that can affect user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The Email::delete_pop section provides a deletion example but does not mention that removing a mailbox can affect access to user mail data and service continuity. For markdown documentation, potentially destructive operations should include a clear user-facing warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file includes a Basic Authentication example using username:password credentials without clearly warning that this method increases risk of credential exposure through shell history, process listings, logs, copied commands, or operational reuse. In a skill that uses exec for API calls, presenting password-based auth examples makes insecure operator behavior more likely and is riskier than ordinary reference text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

Several commands modify live hosting configuration and access control, including suspending accounts, editing DNS, and granting database privileges. The markdown presents them as bare commands without cautionary language about possible service interruption, misrouting, or privilege risks, which fits the missing-warning criteria for markdown files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file documents commands for removing cPanel accounts and deleting email accounts, but it does not provide any user warning about data loss or the irreversible nature of these operations. Under the markdown-specific SQP-2 criteria, omission of warnings for actions affecting user data or system integrity is a reportable issue.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 199)May include surrounding context.

md
## Resources

- [cPanel 134 Release Notes](https://docs.cpanel.net/release-notes/134-release-notes/)
- [API Documentation](https://api.docs.cpanel.net/)
- [Migration Guide](https://docs.cpanel.net/installation-guide/upgrade-to-cpanel-whm-134/)

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/error-codes.md (reported line 216)May include surrounding context.

md
## Resources

- [cPanel 134 Release Notes](https://docs.cpanel.net/release-notes/134-release-notes/)
- [API Documentation](https://api.docs.cpanel.net/)
- [Migration Guide](https://docs.cpanel.net/installation-guide/upgrade-to-cpanel-whm-134/)

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/error-codes.md (reported line 217)May include surrounding context.

md
## Resources

- [cPanel 134 Release Notes](https://docs.cpanel.net/release-notes/134-release-notes/)
- [API Documentation](https://api.docs.cpanel.net/)
- [Migration Guide](https://docs.cpanel.net/installation-guide/upgrade-to-cpanel-whm-134/)

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/version-134-changes.md (reported line 177)May include surrounding context.

md
## Resources

- [cPanel 134 Release Notes](https://docs.cpanel.net/release-notes/134-release-notes/)
- [API Documentation](https://api.docs.cpanel.net/)
- [Migration Guide](https://docs.cpanel.net/installation-guide/upgrade-to-cpanel-whm-134/)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The restore path performs a potentially destructive account restoration immediately, with no confirmation prompt, dry-run mode, or explicit warning. In a hosting administration skill, this increases the chance of accidental data overwrite or service disruption if the wrong backup file or user is supplied.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code file makes an HTTP request using an Authorization header derived from CPANEL_TOKEN, which transmits sensitive credentials to the configured host. Aside from generic usage comments, there is no confirmation prompt, visible disclosure, or warning comment explaining that credentials and request parameters will be sent over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script sends the account password as a plaintext query-string parameter in the URL to the WHM API. Even if HTTPS is used, placing secrets in the URL increases exposure through shell history, process listings, proxy/load-balancer logs, web server logs, and monitoring systems, making credential leakage more likely in an administrative hosting context.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.