Back to skill

Security audit

Edge Tts Global

Security checks for vulnerabilities and agentic risk

Overview

This text-to-speech skill is mostly coherent, but its cleanup helper can delete any user-writable file path, not just the temporary audio files it says it manages.

Review before installing. Use only with non-sensitive text unless you are comfortable sending that text to the online Edge TTS provider, and avoid using the cleanup subcommand until it is constrained to files generated under the workspace temp directory. The skill should be fixed to reject absolute paths, parent traversal, symlinks, and non-MP3/VTT files outside a trusted temp root.

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/tts_edge.py:39
Finding

Unrestricted Arbitrary File Deletion Through Cleanup Command

Content
View full analysis

Vulnerability Details

File Location: scripts/tts_edge.py, lines 39–49
Vulnerability Type: Unrestricted file deletion
Risk Level: High

Vulnerable Code

python
def cleanup(paths: list[str]) -> int:
    for p in paths:
        if not p:
            continue
        try:
            Path(p).unlink(missing_ok=True)
        except TypeError:
            path = Path(p)
            if path.exists():
                path.unlink()
    return 0

Technical Analysis

The cleanup function accepts caller-controlled absolute or relative paths and passes them directly to Path.unlink() without validating their location, file type, ownership, or relationship to files generated by the skill.

Although the documented workflow states that temporary outputs belong in the current caller workspace's temp/ directory, this restriction is not enforced. No canonical-path check ensures that a target remains beneath that directory. The function also does not restrict deletion to expected generated MP3 or VTT files.

This creates an arbitrary-file deletion primitive limited only by the operating-system permissions of the account running the skill. The fallback branch has the same weakness.

Attack Path

  1. An attacker persuades the agent to invoke the documented cleanup subcommand with a path to an unrelated file, or otherwise controls a cleanup path.
  2. The command-line parser stores that path in args.paths.
  3. main() invokes cleanup(args.paths).
  4. The function converts the supplied value to a Path without applying a directory boundary check.
  5. Path.unlink() deletes the target if the skill process has write permission.

Example:

bash
python3 scripts/tts_edge.py cleanup /home/user/project/important-file

Relative traversal paths can likewise target files outside the intended temporary directory:

bash
python3 scripts/tts_edge.py cleanup ./temp/../important-file

Impact Assessment

Successful exploitation can delete any ...[truncated 549 chars]

Remediation
View remediation

Remediation Suggestions

  1. Determine an explicit trusted cleanup root, such as the resolved temp/ directory beneath the caller workspace.
  2. Canonicalize the cleanup root and each requested target with Path.resolve().
  3. Reject every target that is not a strict descendant of the trusted cleanup root.
  4. Reject symbolic links and non-regular files where appropriate.
  5. Restrict cleanup to files created by this skill, preferably by tracking generated paths rather than accepting arbitrary path arguments.
  6. Optionally enforce expected filename patterns and extensions such as .mp3 and .vtt; this should supplement, not replace, the directory-boundary check.
  7. Fail closed with a clear error when validation fails.
  8. Add tests covering absolute paths, .. traversal, symlinks, sibling directories, and valid generated files.

A boundary check can follow this pattern:

python
def cleanup(paths: list[str]) -> int:
    cleanup_root = (Path.cwd() / "temp").resolve()

    for value in paths:
        if not value:
            continue

        target = Path(value).resolve()

        try:
            target.relative_to(cleanup_root)
        except ValueError:
            raise ValueError(f"Refusing to delete path outside {cleanup_root}: {target}")

        if target.is_symlink() or (target.exists() and not target.is_file()):
            raise ValueError(f"Refusing to delete unsupported target: {target}")

        if target.suffix.lower() not in {".mp3", ".vtt"}:
            raise ValueError(f"Refusing to delete unexpected file type: {target}")

        target.unlink(missing_ok=True)

    return 0

For stronger assurance, maintain a per-run allowlist of files successfully generated by the script and permit cleanup only for those recorded paths.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (6)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

cleanup(paths) directly unlinks any provided path without verifying that it belongs to the skill's own output location or was generated by the tool. In the context of a TTS skill, arbitrary path deletion is unjustified and especially dangerous because it can destroy data, interfere with other tools, or erase logs and evidence if invoked with sensitive file paths.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs use of shell-capable commands and environment-dependent tooling but does not declare any explicit tool scope or allowed-tools boundary. That increases the risk of unintended command execution or broader tool access than operators expect, especially because the skill includes direct shell command examples and file deletion steps.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill omits a privacy warning that text supplied by the user may be transmitted to an online Microsoft Edge TTS service when using edge-tts. Users may provide sensitive content assuming purely local processing, creating a confidentiality risk if private or regulated data is spoken through the remote service.

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/tts_edge.py (reported line 34)May include surrounding context.

python
subs_path.parent.mkdir(parents=True, exist_ok=True)
        cmd += ["--write-subtitles", str(subs_path)]

    subprocess.run(cmd, check=True)
    print(str(out_path))
    return 0

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill exposes a cleanup subcommand that deletes arbitrary file paths supplied by the caller, not just files created by this TTS workflow. Because the skill's stated purpose is text-to-speech generation, this extra file-deletion capability broadens the attack surface and can be abused to remove unrelated user or workspace files if an agent or user passes attacker-influenced paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill directs the agent to create and then delete audio files, but it does not clearly warn that it will modify the workspace filesystem. This can surprise users and, if paths are handled incorrectly by the caller or helper script, could lead to unintended deletion of user files.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.