Back to skill

Security audit

YouTube Uploader

Security checks for vulnerabilities and agentic risk

Overview

This YouTube uploader is broadly purpose-aligned, but it warrants Review because it stores broad long-lived YouTube OAuth credentials and auto-installs unpinned dependencies at runtime.

Install only if you are comfortable granting this skill durable access to a YouTube account and allowing it to install Python packages at runtime. Prefer a version that pins dependencies, documents required domains and OAuth scopes, uses narrower YouTube scopes where possible, and provides a clear way to delete or revoke stored credentials.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
scripts/youtube-upload.py:22
Finding

Automatic Installation of Unpinned Third-Party Dependencies

Content
View full analysis
bool: """Check if running inside our dedicated venv.""" return any(str(VENV_DIR) in p for p in sys.path) def ensure_dependencies(): """Install missing Google API packages into a dedicated venv.""" venv_python = VENV_DIR / "bin" / "python3" # If running outside the venv and it exists, re-exec into it directly if venv_python.exists() and not _in_venv(): os.execv(str(venv_python), [str(venv_python), *sys.argv]) # Check if imports are available missing = [] for module_name, pip_name in REQUIRED_PACKAGES: try: __import__(module_name) except ImportError: missing.append(pip_name) if not missing: return # Create venv if needed (first run) if not venv_python.exists(): print("Creating virtual environment for YouTube skill...", file=sys.stderr) subprocess.check_call([sys.executable, "-m", "venv", str(VENV_DIR)]) print(f"Installing dependencies: {', '.join(missing)}", file=sys.stderr) subprocess.check_call([str(venv_python), "-m", "pip", "install", "--quiet", *missing]) # Re-exec inside the venv so imports resolve os.execv(str(venv_python), [str(venv_python), *sys.argv]) ``` ### Technical Analysis The script automatically creates a virtual environment and installs packages from the configured Python package index whenever required imports are unavailable. Package names are not constrained by exact versions, cryptographic hashes ...[truncated 1876 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/youtube-upload.py:76
Finding

OAuth Scopes Exceed the Skill's Minimum Functional Requirements

Content
View full analysis
Remediation
View remediation
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
## Setup (one-time)

The user needs a Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 client ID (type "Desktop app"). Download the `client_secret.json` file.

### Authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
## Setup (one-time)

The user needs a Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 client ID (type "Desktop app"). Download the `client_secret.json` file.

### Authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 208)May include surrounding context.

python
## Setup (one-time)

The user needs a Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 client ID (type "Desktop app"). Download the `client_secret.json` file.

### Authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 462)May include surrounding context.

python
## Setup (one-time)

The user needs a Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 client ID (type "Desktop app"). Download the `client_secret.json` file.

### Authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 463)May include surrounding context.

python
## Setup (one-time)

The user needs a Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 client ID (type "Desktop app"). Download the `client_secret.json` file.

### Authenticate

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 43)May include surrounding context.

python
# If running outside the venv and it exists, re-exec into it directly
    if venv_python.exists() and not _in_venv():
        os.execv(str(venv_python), [str(venv_python), *sys.argv])

    # Check if imports are available
    missing = []

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 64)May include surrounding context.

python
# If running outside the venv and it exists, re-exec into it directly
    if venv_python.exists() and not _in_venv():
        os.execv(str(venv_python), [str(venv_python), *sys.argv])

    # Check if imports are available
    missing = []

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes a Python script that performs shell execution, network access to Google/YouTube, and writes credential files, but the manifest does not declare any explicit tool scope or permissions. This creates an authorization and review gap: operators and users cannot clearly see or constrain the capabilities the skill requires before it runs.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill performs self-bootstrapping by creating a virtualenv, installing packages from the network, and re-executing itself at runtime. In an agent-skill context this expands the trust boundary significantly: executing network-fetched code during normal skill use can introduce supply-chain risk and unexpected host modification beyond the stated upload/auth purpose.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/youtube-upload.py (reported line 49)May include surrounding context.

python
missing = []
    for module_name, pip_name in REQUIRED_PACKAGES:
        try:
            __import__(module_name)
        except ImportError:
            missing.append(pip_name)
    if not missing:

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/youtube-upload.py (reported line 58)May include surrounding context.

python
# Create venv if needed (first run)
    if not venv_python.exists():
        print("Creating virtual environment for YouTube skill...", file=sys.stderr)
        subprocess.check_call([sys.executable, "-m", "venv", str(VENV_DIR)])

    print(f"Installing dependencies: {', '.join(missing)}", file=sys.stderr)
    subprocess.check_call([str(venv_python), "-m", "pip", "install", "--quiet", *missing])

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/youtube-upload.py (reported line 61)May include surrounding context.

python
subprocess.check_call([sys.executable, "-m", "venv", str(VENV_DIR)])

    print(f"Installing dependencies: {', '.join(missing)}", file=sys.stderr)
    subprocess.check_call([str(venv_python), "-m", "pip", "install", "--quiet", *missing])

    # Re-exec inside the venv so imports resolve
    os.execv(str(venv_python), [str(venv_python), *sys.argv])

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script copies the OAuth client secret into persistent local storage for later use without explicit user-facing disclosure or consent. While file permissions are restricted, persistent duplication of sensitive material increases exposure if the account directory is backed up, synced, or later accessed by other local processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script stores access tokens, refresh tokens, client ID, and client secret in a JSON file on disk. Even with chmod 600, this creates a durable local credential cache that could allow unauthorized YouTube account access if the user account, home directory backups, or other local software are compromised.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.