Back to skill

Security audit

Podcast Feed Manager

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent podcast-feed API manager, but it needs review because it handles an API token unsafely and exposes delete operations without built-in confirmation.

Install only if you are comfortable giving the skill a huisheng.fm Agent token that can read and modify your podcast feeds. Use it in an isolated sandbox where other local processes cannot inspect command lines, and require explicit confirmation before update or delete 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run_huisheng.sh:174
Finding
Bearer Token Exposed Through Process Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run_huisheng.sh`, lines 174-188 **Vulnerability Type**: Bearer token disclosure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash if [[ -n "$body" ]]; then http_status="$( curl -sS -o "$tmp_body" -w '%{http_code}' \ -X "$method" \ -H "Authorization: Bearer $HUISHENG_API_TOKEN" \ -H "Content-Type: application/json" \ --data "$body" \ "$url" )" else http_status="$( curl -sS -o "$tmp_body" -w '%{http_code}' \ -X "$method" \ -H "Authorization: Bearer $HUISHENG_API_TOKEN" \ "$url" )" ``` ### Technical Analysis The script interpolates `HUISHENG_API_TOKEN` directly into a command-line argument passed to `curl`. Consequently, the complete `Authorization` header can appear in curl's process argument vector while the request is running. Depending on operating-system permissions, process isolation, and `/proc` configuration, another local process may be able to inspect this value through mechanisms such as `ps`, process-monitoring tools, or `/proc/<pid>/cmdline`. The risk is especially relevant in shared execution environments where multiple workloads run under the same operating-system account. TLS protects the token while it is transmitted to the API, but it does not prevent local disclosure through process metadata. ### Attack Path 1. A user invokes an authenticated command such as `list-feeds`, `create-feed`, or `delete-episode`. 2. The script launches curl with `Authorization: Bearer <token>` in its argument vector. 3. While curl is running, a concurrent local process with sufficient process-inspection privileges reads its command-line arguments. 4. The process extracts the bearer token from the authorization header. 5. The attacker reuses the token to send requests to `https://huisheng.fm/api`. ### Impact Assessment Successful exploitation exposes the user's personal huisheng.fm API bearer token. The att ...[truncated 420 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Avoid passing the bearer token as a command-line argument. Supply the sensitive header through a curl configuration delivered over standard input or through another secret-aware mechanism that does not expose it in the process argument vector. For example, construct a temporary curl configuration with restrictive permissions or pass configuration through standard input, while ensuring the token is correctly escaped for curl configuration syntax. The resulting invocation should contain only a non-sensitive option such as `--config -` in its argument vector. Additional hardening measures should include: 1. Ensure diagnostic output never prints the generated authorization configuration. 2. Unset or narrowly scope `HUISHENG_API_TOKEN` when it is no longer required. 3. Run the skill in an isolated user or container context so unrelated workloads cannot inspect its processes. 4. Review execution tracing and debugging settings to ensure shell tracing cannot print the token. 5. Add an automated test that inspects the curl command line during a request and verifies that the token is absent. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/run_huisheng.sh:171
Finding
API Response Temporary File Is Not Reliably Removed on Failure<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run_huisheng.sh`, lines 171-193 **Vulnerability Type**: Unsafe temporary-file lifecycle **Risk Level**: Low ### Vulnerable Code ```bash tmp_body="$(mktemp)" if [[ -n "$body" ]]; then http_status="$( curl -sS -o "$tmp_body" -w '%{http_code}' \ -X "$method" \ -H "Authorization: Bearer $HUISHENG_API_TOKEN" \ -H "Content-Type: application/json" \ --data "$body" \ "$url" )" else http_status="$( curl -sS -o "$tmp_body" -w '%{http_code}' \ -X "$method" \ -H "Authorization: Bearer $HUISHENG_API_TOKEN" \ "$url" )" fi cat "$tmp_body" rm -f "$tmp_body" if [[ "$http_status" -lt 200 || "$http_status" -gt 299 ]]; then exit 1 fi ``` ### Technical Analysis The use of `mktemp` avoids predictable filename and file-creation race vulnerabilities. However, removal is performed only on the normal execution path after curl and `cat` complete. Because the script enables `set -e`, a curl transport failure or another command error can terminate the script before `rm -f "$tmp_body"` executes. Ordinary interruption can produce the same result. Any response data already written by curl may therefore remain in the system temporary directory. The temporary file will ordinarily be created with restrictive permissions by `mktemp`, reducing exposure to unrelated users. Nevertheless, processes running as the same operating-system user, privileged local processes, backup or forensic tooling, and later executions under permissive environmental conditions may be able to access residual data. ### Attack Path 1. The user initiates an authenticated API request. 2. Curl begins writing the API response to the file created by `mktemp`. 3. Curl encounters a transport error, the shell receives an interruption, or another command fails before explicit cleanup. 4. Due to `set -e`, execution exits before `rm -f "$tmp_body"`. 5. A local actor with sufficient filesystem pri ...[truncated 639 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Register cleanup immediately after the temporary file is created so that normal exits and handled failures remove it: ```bash tmp_body="$(mktemp)" trap 'rm -f -- "$tmp_body"' EXIT ``` After the response has been processed, the script may remove the file explicitly and clear the trap: ```bash rm -f -- "$tmp_body" trap - EXIT ``` Additional hardening measures should include: 1. Validate that `mktemp` succeeded before using the returned path. 2. Set a restrictive `umask`, such as `umask 077`, before creating files containing API responses. 3. Consider capturing bounded response data in memory when response sizes are known to be safe. 4. Add signal handlers for commonly handled termination signals where appropriate. 5. Add tests that force curl to fail and verify that no response temporary file remains afterward. An `EXIT` trap cannot guarantee cleanup after uncatchable termination such as `SIGKILL`, so restrictive file permissions and execution isolation should remain part of the defense. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (10)

Credential Access

High
Category
Privilege Escalation
Content
Authorization: Bearer <HUISHENG_API_TOKEN>
```

The token is the personal Agent access token from the user's dashboard.

## Endpoints
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- `POST /feeds`
- `GET /feeds/{feedKey}`
- `PATCH /feeds/{feedKey}`
- `DELETE /feeds/{feedKey}`
- `GET /feeds/{feedKey}/config`
- `GET /feeds/{feedKey}/episodes`
- `POST /feeds/{feedKey}/episodes`
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
- `POST /feeds/{feedKey}/episodes`
- `GET /feeds/{feedKey}/episodes/{episodeId}`
- `PATCH /feeds/{feedKey}/episodes/{episodeId}`
- `DELETE /feeds/{feedKey}/episodes/{episodeId}`

All endpoints are user-scoped. A token can only access Podcast Feeds owned by the authenticated dashboard user.
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
delete-feed)
    require_arg "${1:-}" "feed key"
    feed_key="$(urlencode "${1:-}")"
    request DELETE "/feeds/$feed_key"
    ;;
  get-feed-config)
    require_arg "${1:-}" "feed key"
Confidence
90% 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
require_arg "${2:-}" "episode id"
    feed_key="$(urlencode "${1:-}")"
    episode_id="$(urlencode "${2:-}")"
    request DELETE "/feeds/$feed_key/episodes/$episode_id"
    ;;
  *)
    json_error "Unknown command: $command_name"
Confidence
90% 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).

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill exposes shell and network capabilities but does not declare any explicit tool scope or permission boundaries in the skill manifest. That omission increases the chance an agent runtime grants broader execution than intended, making it easier for the skill to perform outbound API calls or shell actions without transparent policy review.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Operating Rules

- Require `HUISHENG_API_TOKEN`; do not invent fallback token names.
- Do not ask the user for an API URL; use `https://huisheng.fm/api`.
- Treat all operations as user-scoped. A token can only access Podcast Feeds owned by the authenticated dashboard user.
- Keep JSON arguments as structured JSON. Use `--json-file` for long episode payloads.
- If a feed is not found, list feeds first instead of assuming the feed is global.
Confidence
80% 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.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
This markdown file lists DELETE operations for feeds and episodes, which can affect user data, but it does not include any warning about destructive or irreversible behavior. Under the markdown-specific warning criteria, descriptions that omit warnings about behaviors affecting user data or system integrity should be flagged.

External Transmission

Medium
Category
Data Exfiltration
Content
require_token

  if ! command_exists curl; then
    json_error "curl is required when bundled scripts are unavailable."
    exit 1
  fi
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Vague Triggers

Low
Confidence
84% confidence
Finding
The default prompt tells an agent to use the skill to inspect the user's podcast feeds, but it does not define when invocation is appropriate, what user confirmation is required, or any boundaries on read/write actions. In a tool-using agent environment, vague trigger scope can cause unintended invocation against user-scoped API credentials, increasing the chance of unnecessary data access or accidental feed modifications if the skill supports state-changing operations.

Static analysis

No suspicious patterns detected.