Back to skill

Security audit

Porkbun Domains & DNS

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Porkbun domain-management purpose, but it needs review because it can change live domain settings and its .env credential loader can execute shell code.

Review before installing. Prefer passing Porkbun keys through a secure environment or secret manager, remove the eval-based .env parser, avoid untrusted workspaces, and require an explicit preview and confirmation before DNS, nameserver, forwarding, SSL, or auto-renew actions.

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
scripts/porkbun.sh:11
Finding

Arbitrary Command Execution Through Unsafe .env Evaluation

Content
View full analysis

Vulnerability Details

File Location: scripts/porkbun.sh, lines 11–14
Vulnerability Type: Shell command injection through unsafe configuration parsing
Risk Level: High

bash
if [ -z "${PORKBUN_API_KEY:-}" ]; then
  ENV_FILE="${OPENCLAW_WORKSPACE:-$HOME/.openclaw/workspace}/.env"
  if [ -f "$ENV_FILE" ]; then
    eval "$(grep '^PORKBUN_' "$ENV_FILE" | sed 's/^/export /')"
  fi
fi

Technical Analysis

The script loads credential assignments from a workspace .env file and passes them to eval. Although grep '^PORKBUN_' restricts matching lines by prefix, it does not make their contents safe. Shell substitutions, command separators, redirections, and other shell syntax within a matching assignment are interpreted as executable code.

For example, a matching line can contain command substitution:

bash
PORKBUN_API_KEY=$(attacker-controlled-command)

When the script executes eval, the embedded command runs with the permissions of the user or Agent invoking the Skill. The OPENCLAW_WORKSPACE environment variable can also change which .env file is selected, increasing the risk where that variable or the selected workspace is attacker-controlled.

Executing configuration data as shell code is unnecessary for the declared credential-loading functionality and exceeds the minimum behavior needed to read the two Porkbun keys.

Attack Path

  1. An attacker gains the ability to create or modify the .env file under the selected workspace, or influences OPENCLAW_WORKSPACE so it points to an attacker-controlled directory.
  2. The attacker inserts a line beginning with PORKBUN_ that contains shell syntax, such as command substitution.
  3. The victim invokes any porkbun.sh operation while PORKBUN_API_KEY is absent from the existing process environment.
  4. The script reads the malicious line and supplies it to eval.
  5. The injected command executes before the requested Porkbun API operation proceeds.

Impact Assessment

S ...[truncated 823 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove eval entirely and treat .env contents strictly as data.
  2. Prefer requiring PORKBUN_API_KEY and PORKBUN_SECRET_KEY through the process environment or a dedicated secret manager.
  3. If .env support is required, parse only the two exact variable names with a strict parser that does not interpret shell syntax.
  4. Reject malformed assignments, duplicate keys, command substitutions, expansions, redirections, and unexpected control characters.
  5. Avoid allowing an untrusted OPENCLAW_WORKSPACE value to select the credential file. Resolve the path against an approved workspace root where possible.
  6. Verify that the credential file is a regular file, is not an unexpected symbolic link, and has restrictive ownership and permissions.
  7. Export parsed values without reevaluation. A safer implementation pattern is:
bash
ENV_FILE="${OPENCLAW_WORKSPACE:-$HOME/.openclaw/workspace}/.env"

if [ -z "${PORKBUN_API_KEY:-}" ] && [ -f "$ENV_FILE" ]; then
  while IFS='=' read -r key value; do
    case "$key" in
      PORKBUN_API_KEY|PORKBUN_SECRET_KEY)
        case "$value" in
          *'$('*|*'`'*|*';'*|*'&'*|*'|'*|*'<'*|*'> '*)
            printf 'Unsafe value for %s\n' "$key" >&2
            exit 1
            ;;
        esac
        printf -v "$key" '%s' "$value"
        export "$key"
        ;;
    esac
  done < "$ENV_FILE"
fi

A vetted dotenv parser or secret-management facility is preferable to maintaining custom parsing logic.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
---
name: porkbun-domains
description: Manage domains and DNS via the Porkbun API. Use when asked to list domains, check domain availability, manage DNS records (A, AAAA, CNAME, MX, TXT, etc.), update nameservers, set up URL forwarding, retrieve SSL certificates, check pricing, or toggle auto-renew. Covers all Porkbun API v3 endpoints. NOT for other registrars (Cloudflare, Namecheap, GoDaddy). Requires PORKBUN_API_KEY and PORKBUN_SECRET_KEY in env or workspace .env file.
---

# Porkbun Domains & DNS

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/porkbun.sh (reported line 5)May include surrounding context.

sh
---
name: porkbun-domains
description: Manage domains and DNS via the Porkbun API. Use when asked to list domains, check domain availability, manage DNS records (A, AAAA, CNAME, MX, TXT, etc.), update nameservers, set up URL forwarding, retrieve SSL certificates, check pricing, or toggle auto-renew. Covers all Porkbun API v3 endpoints. NOT for other registrars (Cloudflare, Namecheap, GoDaddy). Requires PORKBUN_API_KEY and PORKBUN_SECRET_KEY in env or workspace .env file.
---

# Porkbun Domains & DNS

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The script is designed to access credentials from a workspace .env file, which broadens the trust boundary from runtime-injected secrets to arbitrary workspace content. In agent environments, workspace files may be influenced by other tools or untrusted project content, making secret consumption less explicit and easier to abuse.

Content

Scanner excerpt · scripts/porkbun.sh (reported line 10)May include surrounding context.

sh
API="https://api.porkbun.com/api/json/v3"

# Load keys from env or .env
if [ -z "${PORKBUN_API_KEY:-}" ]; then
  ENV_FILE="${OPENCLAW_WORKSPACE:-$HOME/.openclaw/workspace}/.env"
  if [ -f "$ENV_FILE" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

Using eval on data derived from a .env file creates a command-injection sink: a maliciously crafted PORKBUN_ line can execute arbitrary shell code when the script loads credentials. Because the workspace is treated as potentially adversarial in an agent context, this is substantially more dangerous than ordinary .env parsing and can lead to code execution plus secret theft.

Content

Scanner excerpt · scripts/porkbun.sh (reported line 12)May include surrounding context.

sh
# Load keys from env or .env
if [ -z "${PORKBUN_API_KEY:-}" ]; then
  ENV_FILE="${OPENCLAW_WORKSPACE:-$HOME/.openclaw/workspace}/.env"
  if [ -f "$ENV_FILE" ]; then
    eval "$(grep '^PORKBUN_' "$ENV_FILE" | sed 's/^/export /')"
  fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents shell-based operations that can modify live domain configuration, but it does not declare any tool scope or allowed-tools boundary. Without explicit restrictions, an agent may invoke shell capabilities more broadly than intended, increasing the chance of unsafe command execution or unintended infrastructure changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup instructions tell users to place Porkbun API credentials in environment variables or a workspace .env file without any guidance on secure storage, access control, or avoiding accidental disclosure. Because these credentials permit domain and DNS changes, mishandling them can lead to takeover or service disruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation includes destructive DNS, nameserver, and forwarding operations without warning that they can immediately disrupt email, websites, TLS validation, or domain control. In a domain-management skill, omission of confirmation and impact warnings makes accidental outage or hijack-like misconfiguration much more likely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 80)May include surrounding context.

md
# Env: PORKBUN_API_KEY, PORKBUN_SECRET_KEY (or reads from .env in workspace)
set -euo pipefail

API="https://api.porkbun.com/api/json/v3"

# Load keys from env or .env
if [ -z "${PORKBUN_API_KEY:-}" ]; then

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/porkbun.sh (reported line 8)May include surrounding context.

sh
# Env: PORKBUN_API_KEY, PORKBUN_SECRET_KEY (or reads from .env in workspace)
set -euo pipefail

API="https://api.porkbun.com/api/json/v3"

# Load keys from env or .env
if [ -z "${PORKBUN_API_KEY:-}" ]; then

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script automatically sources Porkbun API credentials from a workspace .env file without any notice, consent step, or restriction beyond a filename convention. In an agent setting, this creates a surprising credential-use path and increases the chance that a user invokes the skill without realizing it will access and transmit stored secrets to a remote API.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · scripts/porkbun.sh (reported line 24)May include surrounding context.

sh
AUTH="{\"apikey\":\"$PORKBUN_API_KEY\",\"secretapikey\":\"$PORKBUN_SECRET_KEY\"}"

post() {
  curl -s -X POST "$1" -H "Content-Type: application/json" -d "${2:-$AUTH}"
}

merge() {

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes destructive operations such as DNS deletion, nameserver updates, URL forwarding changes, and auto-renew toggles with no confirmation, dry-run, or safety interlock. In an agent workflow, a mistaken or prompt-injected invocation could immediately alter production domain behavior and cause outages or traffic hijacking.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.