Back to skill

Security audit

magic-hour

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Magic Hour media-generation integration, but its local upload workflow is under-scoped and could send unintended local files to the vendor.

Install only if you are comfortable sending prompts and selected media to Magic Hour. Use a dedicated API key, avoid secrets or private files in prompts/uploads, run the SDK in an isolated environment, and only pass explicit non-sensitive image files to `image_to_video.py`.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:27
Finding

Unpinned Third-Party SDK Executes with Access to API Credentials

Content
View full analysis
= 3.9) ``` ```python def get_client(api_key: Optional[str] = None, timeout: Optional[float] = None): key = api_key or os.environ.get(ENV_VAR) if not key: fail( f"{ENV_VAR} is not set. Get a free key (400 credits + 100/day, no card) " "at https://magichour.ai/developer" ) try: from magic_hour import Client except ImportError: fail("magic_hour SDK not installed. Run: pip install magic_hour") kwargs: Dict[str, Any] = {"token": key} if timeout is not None: kwargs["timeout"] = timeout return Client(**kwargs) ``` ### Technical Analysis The installation instructions retrieve the latest available `magic_hour` package without pinning a reviewed version or verifying an integrity hash. Python packages can run arbitrary code during installation and import. The imported package is also explicitly given the value of `MAGIC_HOUR_API_KEY`. The project identifies the package as the official SDK, and the audit found no evidence that the currently published package is malicious. Nevertheless, the absence of version and integrity controls creates a supply-chain trust gap: a compromised maintainer account, malicious replacement release, or unexpectedly incompatible future release could change the code executed by this Skill after its source has been reviewed. ### Attack Path 1. An attacker compromises the package publication process or publishes a malicious future release through the trusted package channel. 2. A user follows the documented `pip install mag ...[truncated 1001 chars]
Remediation
View remediation
``` 2. Maintain a lock file containing cryptographic hashes and install with hash verification, such as: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Record the package version tested by the project and update it only after reviewing release notes, package provenance, and dependency changes. 4. Prefer an isolated virtual environment or restricted container rather than installing into a privileged or shared Python environment. 5. Avoid running package installation as root or with `sudo`. 6. Restrict the API key to the minimum account permissions available, rotate it if dependency compromise is suspected, and avoid exposing unrelated secrets to the process. 7. Add automated dependency scanning and provenance verification to the release process. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/image_to_video.py:32
Finding

Insufficient Validation of Local Files Before Remote Upload

Content
View full analysis
None: args = build_parser().parse_args(argv) if not args.image.startswith(("http://", "https://", "api-assets/")) and not os.path.exists(args.image): c.fail(f"image not found: {args.image}") warn = c.validate_video(args.model, args.duration, args.resolution) if warn: print(f"warning: {warn}", file=sys.stderr) def go(): client = c.get_client(timeout=args.timeout) resp = client.v1.image_to_video.generate( assets={"image_file_path": args.image}, ``` The corresponding argument is described as follows: ```python p.add_argument("image", help="Local image path (png/jpg/webp) or public https:// URL") ``` ### Technical Analysis The interface states that the local input should be a PNG, JPG, or WebP image, but validation only uses `os.path.exists()`. This does not establish that the path: - Refers to a regular file. - Is not a symbolic link to another file. - Contains a supported image format. - Is within an approved input directory. - Is below an acceptable upload-size limit. The path is then passed to the Magic Hour SDK as `image_file_path`. The Skill documentation explicitly states that local files are uploaded automatically by the SDK. Consequently, any existing path accepted by the SDK may be transmitted to the remote service, including a sensitive readable file selected accidentally or through malicious instructions. Whether a non-image file is ultimately accepted by the remote API depends on SDK and server-side validation. Client-side enforcement is nevertheless absent, and symbolic links or files with misleading extensions may bypass superficial expectations. ### Attack Path 1. An attacker supplies an untrusted task or instruction that ...[truncated 1108 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents use of environment variables and local file output/download behavior but does not declare an explicit tool scope such as permissions or allowed-tools. That omission weakens reviewability and user consent because an agent may use filesystem and secret-backed capabilities without a clearly bounded declaration, increasing the chance of unintended file writes or misuse of the API key.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill encourages attaching a remote MCP server with bearer-token authorization but does not clearly warn that prompts, generated content requests, and possibly user-supplied media will be transmitted to a third-party service. This can cause inadvertent disclosure of sensitive user data or secrets, especially when an agent forwards rich context automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The image-to-video workflow states that a local file is uploaded automatically, but it does not prominently warn that local user files are being transmitted off-device to an external API. In an agent setting, this is dangerous because users may assume a local transformation while private images are actually exfiltrated to a remote provider.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/api.md (reported line 3)May include surrounding context.

md
# Magic Hour raw HTTP reference

Base URL: `https://api.magichour.ai/v1`. Auth header: `Authorization: Bearer $MAGIC_HOUR_API_KEY`. All bodies are JSON.

## Create jobs

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/api.md (reported line 31)May include surrounding context.

md
# Magic Hour raw HTTP reference

Base URL: `https://api.magichour.ai/v1`. Auth header: `Authorization: Bearer $MAGIC_HOUR_API_KEY`. All bodies are JSON.

## Create jobs

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/api.md (reported line 34)May include surrounding context.

md
# Magic Hour raw HTTP reference

Base URL: `https://api.magichour.ai/v1`. Auth header: `Authorization: Bearer $MAGIC_HOUR_API_KEY`. All bodies are JSON.

## Create jobs

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/api.md (reported line 35)May include surrounding context.

md
# Magic Hour raw HTTP reference

Base URL: `https://api.magichour.ai/v1`. Auth header: `Authorization: Bearer $MAGIC_HOUR_API_KEY`. All bodies are JSON.

## Create jobs

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documentation explicitly instructs users to authenticate to a third-party API and upload local image bytes, but it does not warn that prompts, media, and local files will be transmitted off-system to an external service. In an agent skill context, that omission can lead users or downstream tooling to send sensitive local content or secrets-bearing files to the vendor without informed consent.

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 · references/api.md (reported line 28)May include surrounding context.

  1. PUT the raw bytes to upload_url.
  2. Use file_path as assets.image_file_path.

curl example

bash
ID=$(curl -s https://api.magichour.ai/v1/text-to-video \

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/_common.py (reported line 100)May include surrounding context.

python
}
    if kind == "video":
        for k in ("width", "height", "fps"):
            payload[k] = getattr(response, k, None)
    paths = getattr(response, "downloaded_paths", None)
    if paths:
        payload["downloaded_paths"] = list(paths)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script sends the user's prompt, optional name metadata, and generation parameters to the external Magic Hour API, but this file does not provide a clear user-facing warning at the point of use that the content will leave the local environment. This creates a privacy and data-handling risk if users include sensitive, proprietary, or regulated information in prompts, even though exfiltration to the third-party service is the expected function of the skill.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.