Back to skill

Security audit

S2-SP-OS Vision Cast

Security checks for vulnerabilities and agentic risk

Overview

This skill is not clearly malicious, but it asks for execution, network probing, and a vision token while giving misleading or under-scoped casting and privacy guarantees.

Install only after the publisher narrows activation to user-confirmed devices, removes global token access for sniffing, documents token handling and snapshot destinations, and fixes the implementation so it either performs verified delivery or reports not implemented instead of success.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
vision_cast.py:76
Finding

Projection Functions Report Successful Secure Delivery Without Performing Any Transfer

Content
View full analysis

Vulnerability Details

File Location: vision_cast.py, lines 76-80; success output is generated at lines 105-116
Vulnerability Type: False security and delivery claims
Risk Level: Medium

Vulnerable Code

python
def cast_via_dlna(self, media_url: str) -> dict:
    return {"protocol": "UPnP/DLNA", "target": self.target_ip, "status": "Dispatched"}

def push_secure_snapshot(self, image_path: str, token: str) -> dict:
    return {"protocol": "S2_Secure_REST", "status": "Snapshot_Pushed", "privacy": "Ephemeral_30s"}

The returned values are subsequently presented as successful authorized operations:

python
elif args.mode == "dlna_cast":
    core_tensors = dispatcher.cast_via_dlna(args.media_url)
    vendor_nl = "UPnP SOAP command dispatched. / UPnP指令已下发。"
elif args.mode == "snapshot_push":
    core_tensors = dispatcher.push_secure_snapshot(args.payload, vision_token)
    vendor_nl = "Snapshot dispatched via S2 Fallback. / 已通过S2兜底协议推送加密快照。"

print(json.dumps({
    "status": "AUTHORIZED_VISION_CAST",
    "architecture_compliance": "SNIFF_FIRST_PUSH_LATER_NO_SERVER",

Technical Analysis

Neither projection method implements the operation it claims to perform. The DLNA method does not construct or transmit a UPnP SOAP request. The snapshot method does not:

  • Open or validate the supplied image.
  • Connect to the target device.
  • Encrypt the image.
  • Use the supplied authentication token.
  • Receive delivery confirmation.
  • Implement or verify deletion after 30 seconds.

Despite this, the methods return Dispatched, Snapshot_Pushed, and Ephemeral_30s, and the main routine reports AUTHORIZED_VISION_CAST. This is a fail-open reporting design: unperformed or failed security-sensitive actions are represented as successful.

The behavior directly contradicts the documented secure-push and ephemeral-deletion guarantees. It can cause an agent or operator to make confidenti ...[truncated 1359 chars]

Remediation
View remediation

Remediation Suggestions

  • Implement the documented network protocols before returning a success state.
  • For DLNA, validate media_url, construct the required UPnP SOAP request, enforce connection and read timeouts, and check the receiver's HTTP and SOAP response.
  • For snapshot delivery, validate the image path and type, encrypt the content using an authenticated encryption scheme, authenticate the receiver, and use the token only through a documented authorization protocol.
  • Require positive receiver acknowledgement before returning Snapshot_Pushed.
  • Implement receiver-side expiry and deletion, then distinguish between requested expiry and confirmed deletion.
  • Return explicit states such as not_implemented, delivery_failed, delivery_unconfirmed, and deletion_unconfirmed.
  • Never emit AUTHORIZED_VISION_CAST, Dispatched, or Ephemeral_30s unless the corresponding operation has been completed and verified.
  • Add integration tests using a controlled receiver to verify transfer, authentication, failure handling, and deletion behavior.

T05 · Unauthorized Access and Privilege Escalation

Note
Location
vision_cast.py:83
Finding

Unnecessary Vision Token Access Violates Least Privilege

Content
View full analysis

Vulnerability Details

File Location: vision_cast.py, lines 83-89; requirement declared in SKILL.md, lines 8 and 24
Vulnerability Type: Unnecessary credential access
Risk Level: Low

Vulnerable Code

python
def main():
    if os.environ.get("S2_PRIVACY_CONSENT") != "1":
        print(json.dumps({"error": "SECURITY BLOCK: S2_PRIVACY_CONSENT=1 is missing."}, ensure_ascii=False))
        sys.exit(1)
        
    vision_token = os.environ.get("S2_VISION_TOKEN")
    if not vision_token:
        print(json.dumps({"error": "SECURITY BLOCK: S2_VISION_TOKEN is missing."}, ensure_ascii=False))
        sys.exit(1)

The Skill metadata requires the token for the entire Skill:

yaml
metadata: {"clawdbot":{"emoji":"👁️","requires":{"bins":["python3"], "pip":["requests"], "env":["S2_PRIVACY_CONSENT", "S2_VISION_TOKEN"]}}}

Technical Analysis

The process requires and reads S2_VISION_TOKEN before parsing or dispatching the selected mode. Consequently, the token must be exposed even when the requested operation is only a local TCP port scan.

The current snapshot implementation accepts the token as an argument but does not use it for authentication, authorization, encryption, or transmission. Requiring the credential therefore provides no security benefit.

This violates least privilege by expanding secret availability beyond the code path that legitimately requires it. Although no exfiltration mechanism was found in the audited implementation, unnecessary secret exposure increases the consequences of future code injection, dependency compromise, debugging output, crash handling, or process inspection.

Attack Path

  1. The operator follows SKILL.md and provisions S2_VISION_TOKEN in the Skill's environment.
  2. The user requests only --mode sniff, which requires socket access but no authenticated service.
  3. The process nevertheless reads and retains access to the token.
  4. A ...[truncated 746 chars]
Remediation
View remediation

Remediation Suggestions

  • Parse the selected mode before requesting mode-specific credentials.
  • Do not require or read S2_VISION_TOKEN for sniff.
  • Require the token only inside a fully implemented authenticated push operation.
  • Remove the token from global Skill requirements if the orchestration platform supports per-operation secret injection.
  • Prefer a short-lived, narrowly scoped token restricted to the intended target and operation.
  • Avoid retaining the token in long-lived objects or including it in logs, exceptions, command lines, or result data.
  • Document the token's exact authorization scope and rotation procedure.
  • Add tests confirming that unauthenticated sniffing runs without the token and that protected operations fail closed when authentication is absent.

T08 · Insecure Dependencies

Note
Location
vision_cast.py:12
Finding

Unused Unpinned Runtime Dependency Creates Avoidable Supply-Chain Exposure

Content
View full analysis

Vulnerability Details

File Location: vision_cast.py, lines 12-16; dependency declared in SKILL.md, line 8
Vulnerability Type: Unpinned and unnecessary third-party dependency
Risk Level: Low

Vulnerable Code

python
try:
    import requests
except ImportError:
    print(json.dumps({"error": "Please run: pip install requests"}, ensure_ascii=False))
    sys.exit(1)

The dependency is declared without a version or integrity constraint:

yaml
metadata: {"clawdbot":{"emoji":"👁️","requires":{"bins":["python3"], "pip":["requests"], "env":["S2_PRIVACY_CONSENT", "S2_VISION_TOKEN"]}}}

Technical Analysis

The Skill refuses to execute unless requests is installed and explicitly instructs the operator to install it using an unconstrained package name. However, the audited implementation does not use requests anywhere after importing it.

An unpinned dependency allows installation behavior to vary over time and across package indexes. It also unnecessarily expands the process's dependency graph and attack surface. Package installation may execute package build or installation logic, while imported packages execute top-level initialization code.

No evidence was found that the legitimate requests package is malicious. The vulnerability is the avoidable, unversioned supply-chain dependency rather than a confirmed malicious package.

Attack Path

  1. The user invokes the Skill in an environment without requests.
  2. The Skill exits and instructs the user to run pip install requests, or the Skill manager installs the declared requirement automatically.
  3. Package resolution uses the environment's configured index and selects an unconstrained version.
  4. A compromised package release, compromised index, or unsafe mirror could introduce code during installation or import.
  5. That code would execute with the permissions and environment secrets available to the Skill process.

...[truncated 491 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the requests import and the corresponding metadata requirement because the current implementation does not use it.
  • If a future implementation genuinely requires the package, pin an audited version.
  • Use a lock file with cryptographic hashes and install with hash verification.
  • Resolve dependencies only from a trusted, authenticated package index.
  • Use isolated virtual environments and disable unnecessary source builds where practical.
  • Add automated dependency vulnerability and provenance scanning.
  • Keep network functionality on Python's standard library when that adequately satisfies the documented behavior and reduces dependency risk.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Lp1

High
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The code opens TCP connections to multiple ports on a target host and also imports requests, which is clear network-capable behavior not covered by declared permissions. In an agent skill, undeclared network capability is especially risky because it can be used for internal reconnaissance or unauthorized communication without transparent authorization.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The code opens TCP connections to multiple ports on a target host and also imports requests, which is clear network-capable behavior not covered by declared permissions. In an agent skill, undeclared network capability is especially risky because it can be used for internal reconnaissance or unauthorized communication without transparent authorization.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file sets a high-level rule that visual pushes require explicit or at least well-scoped authorization, but Example 3 forwards third-party content from an untrusted source based on inferred preferences and schedule data rather than a direct user decision. That creates a policy bypass where the agent can disclose or relay visual content to a personal device using broad behavioral inference, expanding the chance of unwanted surveillance, manipulation, or privacy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Referencing an S2_VISION_TOKEN as the basis for pushes without documenting credential sensitivity and transmission implications can encourage unsafe handling of a powerful capability token. If such tokens are over-scoped, exposed in logs, or used without strong user awareness, an attacker or over-privileged agent could send visual payloads to devices without meaningful consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation normalizes silent encrypted snapshot pushes to a user's phone or screen without clear disclosure that visual data is being transmitted to another device and displayed there. Even if encrypted, covert delivery to personal endpoints can expose sensitive imagery, surprise users, and create a channel for unauthorized monitoring or social engineering.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example authorizes access to sensitive personal context such as schedule and inferred interests to decide whether to deliver external visual content, which exceeds the minimum capability expected of a casting/projection skill. This violates least-privilege principles and creates unnecessary privacy risk because personal profiling data is being used as a routing and authorization signal for third-party content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill presents broad instructions to sniff a target IP and decide follow-on actions, but it does not narrowly define when the skill should activate or what constitutes authorized targets. That ambiguity is dangerous because an agent may initiate network probing or content transmission in contexts where the user only asked about casting generally, leading to unintended scanning or interaction with devices on the local network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The description advertises an 'Environment Sniffer' that scans target IPs or subnets for open casting ports, but it does not prominently warn users that network scanning will occur. In this context, the omission is material because the skill is designed to perform active reconnaissance on local devices, which can violate user expectations, policy boundaries, or network rules if triggered casually.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description does not clearly warn that visual data may be transmitted through an S2 fallback push path after protocol detection. This is more dangerous in context because screenshots or alert images can contain sensitive information, and the fallback infrastructure is only described as 'secure' and 'ephemeral' without concrete trust, storage, retention, or routing guarantees.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill explicitly requires an environment variable token for a network-based fallback push mechanism, expanding behavior beyond local protocol discovery into authenticated data transmission. In context, this increases the chance that an agent will handle secrets and send visual content to external or semi-external infrastructure without a strongly bounded trust model, user confirmation flow, or data handling warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The sniff mode performs active TCP probing against several service ports on a LAN host without any user-facing disclosure in output beyond a generic success message. In context, this is more dangerous because the skill is framed as a casting helper, but it also acts as a protocol scanner that can support internal network reconnaissance under the guise of device discovery.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The inline comment states that the previous version's complete _build_upnp_soap_payload, cast_via_dlna, and push_secure_snapshot functions are preserved unchanged. However, the visible implementations merely return static dictionaries and perform no SOAP construction, no DLNA dispatch, and no secure snapshot push, directly contradicting the documentation comment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill reads S2_PRIVACY_CONSENT and S2_VISION_TOKEN from the environment even though the implemented functionality is mostly local protocol probing and stubbed dispatch functions. Accessing secrets and consent state without strong necessity expands the attack surface and creates a path for credential misuse or hidden authorization gating.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Multiple example responses and much of the instructional content are written in Chinese, including direct user-facing phrasing, but the file does not indicate that the skill is intended only for Chinese-speaking users or offer any language opt-in. This can constitute a language/locale policy issue because it implicitly forces a language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The code accesses a token from the environment without informing the user in any meaningful way that credentials are being consumed. While the current implementation does not exfiltrate the token, silent secret access reduces transparency and can normalize unnecessary credential handling in a skill with broad network behavior.

Content

No source excerpt is available for this finding.