Back to skill

Security audit

podcast-highlights-deck

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it builds a podcast highlight website, but users should be aware it downloads/transcribes audio and includes a small clipping-script path validation flaw.

Install/use this only for podcast episodes you have rights to process. Expect it to contact podcast/RSS/video sources, download audio locally, and possibly send audio to an external transcription API if the primary transcription tool fails. Keep generated highlights IDs simple such as h1-h12, and validate source URLs before publishing the generated site.

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/clip_audio.py:47
Finding

Path Traversal Through Unvalidated Highlight IDs

Content
View full analysis

Vulnerability Details

File Location: scripts/clip_audio.py, lines 47–73
Vulnerability Type: Path traversal and arbitrary file creation
Risk Level: Medium

Vulnerable Code

python
for h in data.get("highlights", []):
    hid = h["id"]
    start = max(0.0, float(h["start"]) - args.pad_before)
    end = float(h["end"]) + args.pad_after
    dur = max(0.1, end - start)
    out = out_audio_dir / f"{hid}.mp3"

    cmd = [
        "ffmpeg",
        "-hide_banner",
        "-loglevel",
        "error",
        "-ss",
        f"{start:.3f}",
        "-i",
        str(audio),
        "-t",
        f"{dur:.3f}",
        "-c:a",
        "libmp3lame",
        "-q:a",
        str(args.q),
        str(out),
    ]
    run(cmd)

    h.setdefault("clip", {})
    h["clip"]["file"] = f"audio/{hid}.mp3"
    h["clip"]["start"] = start
    h["clip"]["end"] = end

Technical Analysis

The id property is read from highlights.json and incorporated into an output pathname without validation or canonical-path containment checks. A value containing traversal components such as ../ can cause the resolved output path to escape out_audio_dir.

Although the ffmpeg process is safely started with an argument array rather than through a shell, this only prevents shell metacharacter injection. It does not prevent path traversal. The untrusted path is passed to ffmpeg as its output destination, enabling file creation outside the intended site_assets/audio directory where the operating-system permissions and ffmpeg behavior permit it.

The malicious ID is also written into h["clip"]["file"], allowing the unsafe path to persist in the updated JSON data.

Attack Path

  1. An attacker supplies or modifies the highlights.json file used by the documented clipping workflow.
  2. The attacker assigns a highlight an ID containing traversal components, for example:
    json

...[truncated 1316 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce a strict identifier allowlist before using an ID in a pathname:

    python
    import re
    
    SAFE_ID = re.compile(r"^[A-Za-z0-9_-]+$")
    
    hid = h["id"]
    if not isinstance(hid, str) or not SAFE_ID.fullmatch(hid):
        raise ValueError(f"Invalid highlight id: {hid!r}")
    
  2. Resolve the destination and verify that it remains within the intended directory:

    python
    base = out_audio_dir.resolve()
    out = (base / f"{hid}.mp3").resolve()
    
    if out.parent != base:
        raise ValueError("Output path escapes the audio directory")
    
  3. Reject absolute paths, path separators, . and .. components explicitly, even if an allowlist is also present.

  4. Define and validate the complete JSON schema before processing. Require finite, non-negative timestamps and ensure end is greater than start.

  5. Decide on a safe overwrite policy. For example, fail if an output already exists unless an explicit --overwrite option is supplied.

T09 · Insecure Skill Coding Practices

Note
Location
assets/template/Home.tsx:409
Finding

Unvalidated External URL Used in Navigation Links

Content
View full analysis

Vulnerability Details

File Location: assets/template/Home.tsx, lines 409–416 and 780–789
Vulnerability Type: Unsafe URL scheme and untrusted external navigation
Risk Level: Low

Vulnerable Code

tsx
<a
  className="group inline-flex items-center gap-2 text-xs text-foreground"
  href={data.podcast.source_url}
  target="_blank"
  rel="noreferrer"
>
  <span style={{ fontFamily: "var(--font-mono)" }}>{UI[lang].openInApple}</span>
  <ArrowUpRight className="h-4 w-4 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5" />
</a>

The same unvalidated field is used again in the closing section:

tsx
<a
  className="inline-flex items-center gap-2 rounded-full border border-border bg-card/70 px-4 py-2 text-xs"
  href={data.podcast.source_url}
  target="_blank"
  rel="noreferrer"
>
  <span style={{ fontFamily: "var(--font-mono)" }}>{UI[lang].listenFull}</span>
  <ArrowUpRight className="h-4 w-4" />
</a>

Technical Analysis

data.podcast.source_url originates from generated or imported highlight data and is assigned directly to an anchor's href. The template does not parse the value or restrict it to an expected protocol such as HTTPS.

If an attacker can influence the bundled JSON, they can substitute a deceptive external destination or a non-web scheme. Depending on browser and framework handling, unsafe schemes can create script-navigation or application-launch risks. An attacker-controlled HTTPS destination can also present a phishing page while the surrounding interface labels the link as a trusted podcast destination.

target="_blank" is paired with rel="noreferrer", which mitigates opener-based tabnabbing. It does not validate the destination or its protocol.

Attack Path

  1. An attacker controls or alters the highlights.json data before the static site is bundled.
  2. The attacker replaces podcast.source_url with a malicio ...[truncated 1012 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate the source URL when producing or importing highlights.json. Permit only explicitly required protocols, preferably https::

    tsx
    function safeExternalUrl(value: string): string | null {
      try {
        const parsed = new URL(value);
        return parsed.protocol === "https:" ? parsed.href : null;
      } catch {
        return null;
      }
    }
    
  2. Render the link only when validation succeeds:

    tsx
    const sourceUrl = safeExternalUrl(data.podcast.source_url);
    
    {sourceUrl && (
      <a
        href={sourceUrl}
        target="_blank"
        rel="noopener noreferrer"
      >
        {UI[lang].listenFull}
      </a>
    )}
    
  3. If the interface specifically claims to open a supported podcast provider, enforce an allowlist of expected hostnames in addition to the HTTPS requirement.

  4. Reject malformed URLs and dangerous protocols including javascript:, data:, file:, and unexpected custom schemes during schema validation.

  5. Retain rel="noopener noreferrer" for links opened in a new browsing context.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (9)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/template/Home.tsx` → `src/pages/Home.tsx`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/template/Home.tsx` → `src/pages/Home.tsx`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill directs use of shell, file read/write, and external utilities, but it does not declare any explicit tool scope or permission boundaries. That makes the skill harder to audit and increases the risk of over-broad execution in environments where the agent may have more capabilities than the author intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The fallback path sends podcast audio to an external transcription API without an explicit privacy or data-handling warning. Audio may contain copyrighted, private, or sensitive spoken content, so silent transfer to a third party creates confidentiality, compliance, and consent risks.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/clip_audio.py (reported line 22)May include surrounding context.

python
def run(cmd: list[str]) -> None:
    subprocess.check_call(cmd)


def main() -> None:

Tainted flow: 'data' from pathlib.Path.read_text (line 41, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/clip_audio.py (reported line 74)May include surrounding context.

python
h["clip"]["start"] = start
        h["clip"]["end"] = end

    highlights_path.write_text(json.dumps(data, ensure_ascii=False, indent=2), "utf-8")


if __name__ == "__main__":

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The workflow instructs the agent to fetch remote podcast pages/RSS feeds and download audio into local storage without any user-facing disclosure or consent checkpoint. This can surprise users, create unwanted local artifacts, and trigger network access to third-party domains they did not explicitly approve.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The multilingual UI object is meant to provide globally translated labels, but the English entries for host, guest, length, and openInApple are literal strings like "{UI[lang].host}" rather than real labels. This contradicts the apparent intent of the localization data structure and causes the UI to display placeholder-like text instead of the documented multilingual interface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This JSON example embeds multilingual fields such as quote_ja, takeaway_ja, quote_zh, and takeaway_zh alongside English content. Because the file provides alternate locales without any forced single-language behavior or instruction to use one language only, this is at most a mild policy concern, but there is no indication of user language selection or opt-in.

Content

No source excerpt is available for this finding.