Back to skill

Security audit

SGLang-Diffusion Video Generation

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it can send prompts, images, and API keys over plain HTTP to user-specified servers without strong warnings or transport safeguards.

Review before installing. Use it only with a trusted SGLang-Diffusion server, prefer localhost or HTTPS for remote servers, avoid passing API keys on the command line, and do not submit private images or sensitive prompts to an untrusted or plain-HTTP endpoint.

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/generate_video.py:58
Finding

Sensitive prompts, images, and API credentials can be transmitted over unencrypted HTTP

Content
View full analysis
dict: headers = {"Content-Type": "application/json"} if api_key: headers["Authorization"] = f"Bearer {api_key}" return headers def _api_request( url: str, headers: dict, data: bytes | None = None, method: str = "GET", timeout: int = 30 ) -> dict: """Make an HTTP request and return parsed JSON.""" req = urllib.request.Request(url, method=method, headers=headers, data=data) try: with urllib.request.urlopen(req, timeout=timeout) as resp: return json.loads(resp.read().decode("utf-8")) ``` ```python if input_image: img_path = Path(input_image).expanduser() if not img_path.exists(): raise FileNotFoundError(f"Input image not found: {img_path}") b64 = base64.b64encode(img_path.read_bytes()).decode("ascii") body["input_reference"] = b64 data = json.dumps(body).encode("utf-8") headers = _build_headers(api_key) res = _api_request(url, headers, data=data, method="POST", timeout=60) ``` ```python ap.add_argument( "--server", default="http://127.0.0.1:30000", help="SGLang-Diffusion server URL (default: http://127.0.0.1:30000).", ) ``` The documentation explicitly demonstrates using a non-loopback plaintext HTTP destination at `SKILL.md:42`: ```bash python3 {baseDir}/scripts/generate_video.py --prompt "flying through clouds" --server http://192.168.1.100:30000 --out ./my-video.mp4 ``` ### Technical Analysis The script accepts an unrestricted server URL and sends an optional bearer credential through the `Authorization` header. It also sends the user's prompt and, when image-to-video generati ...[truncated 2081 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_video.py:239
Finding

API keys may be exposed through command-line arguments and shell history

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

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

python
def get_api_key(provided_key: str | None) -> str | None:
   """Get API key from argument first, then environment."""
   if provided_key:
       return provided_key
   return os.environ.get("SGLANG_DIFFUSION_API_KEY")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises and documents capabilities that involve network access, environment-variable use, and file writes, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates an authorization gap: an agent or platform may permit broader execution than users expect, especially since the skill can contact arbitrary server URLs and write output files automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill documentation tells the agent to generate videos and notes elsewhere that output defaults to timestamped MP4 files in /tmp/, but it does not clearly warn at the usage point that invoking the skill will write files to disk automatically. This can lead to unexpected persistence of generated media, possible storage of sensitive prompts/results, and user surprise if a custom output path is used.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.