Back to skill

Security audit

social-media-title-insight

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly performs social-media title analysis, but it under-discloses external code loading, raw cookie forwarding, and unsafe dependency installation.

Install only if you are comfortable with reports loading code from Tailwind's CDN, account identifiers being sent to Tezign's API, and local run data being retained. Do not pass browser session cookies through --cookie; use local file analysis where possible and install dependencies in an isolated virtual environment rather than system Python.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:17
Finding
Unpinned Dependencies and Unsafe System-Wide Package Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:17`; related dependency declaration at `scripts/html_to_pdf.py:3-6` **Vulnerability Type**: Unpinned third-party dependencies and unsafe package installation **Risk Level**: Medium ### Vulnerable Code ```bash pip install pandas openpyxl --break-system-packages -q ``` The PDF conversion script also declares an unconstrained dependency: ```python # /// script # requires-python = ">=3.10" # dependencies = [ # "playwright", # ] # /// ``` ### Technical Analysis The installation instructions do not constrain `pandas` or `openpyxl` to reviewed versions or verify package hashes. The inline dependency declaration likewise allows the package resolver to retrieve any compatible version of `playwright`. Using `--break-system-packages` bypasses Python's externally managed environment protection. This may overwrite or conflict with operating-system-managed packages, unnecessarily expanding the effect of the Skill's dependency installation beyond an isolated project environment. This behavior introduces supply-chain and environment-integrity risks: 1. A compromised or unexpectedly modified dependency release may be selected at installation time. 2. Package installation code executes with the privileges of the user running the command. 3. System Python packages may be replaced or left in an inconsistent state. 4. A future dependency release could behave differently from the version originally reviewed. There is no evidence that the named packages are malicious. The vulnerability is the absence of version and integrity controls combined with instructions to bypass system package-management safeguards. ### Attack Path 1. An attacker compromises a permitted dependency release, its distribution account, or the package-resolution path. 2. The user follows the documented installation command or runs the inline dependency script. 3. The resolver downloads the malicious or unexpectedly changed package becau ...[truncated 870 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `--break-system-packages` from all installation instructions. 2. Create and use an isolated virtual environment or another reproducible project environment. 3. Pin every dependency to an exact reviewed version. 4. Maintain a lock file containing transitive dependency versions. 5. Require cryptographic hashes where supported, such as with `pip install --require-hashes`. 6. Configure an approved package index rather than relying on unrestricted resolver configuration. 7. Pin the Playwright version in the inline dependency metadata. 8. Document and pin the compatible Chromium/browser revision used by Playwright. 9. Regularly scan locked dependencies for known vulnerabilities and review updates before changing the lock file. For example: ```bash python -m venv .venv . .venv/bin/activate python -m pip install --require-hashes -r requirements.txt ``` ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/data_tool.py:850
Finding
Generated Reports Execute Mutable Third-Party JavaScript<![CDATA[ ## Vulnerability Details **File Location**: `scripts/data_tool.py:850-853`; execution during PDF conversion at `scripts/html_to_pdf.py:31-35` **Vulnerability Type**: Remote executable content loaded into reports containing user data **Risk Level**: High ### Vulnerable Code The generated report imports an unpinned remote script: ```python return f"""<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{_esc(name)} 内容标题洞察报告</title> <script src="https://cdn.tailwindcss.com"></script> ``` The PDF conversion script opens the report in a browser and explicitly waits for network content: ```python with sync_playwright() as p: browser = p.chromium.launch() page = browser.new_page() page.goto(file_url, wait_until="networkidle") page.wait_for_timeout(2000) # wait for Tailwind CDN to load ``` ### Technical Analysis Every generated report references `https://cdn.tailwindcss.com`, a mutable remote JavaScript resource. The report does not pin a specific immutable asset, provide Subresource Integrity metadata, or enforce a restrictive Content Security Policy. The report DOM can contain user-supplied or potentially sensitive information, including: - Social-media titles - Account or brand names - Engagement metrics - Example high-performing titles - Qualitative insights Because the Tailwind CDN resource is JavaScript rather than static local CSS, code returned by the remote server executes inside the report document. That code can inspect and modify the report DOM and initiate outbound network requests. The effective executable payload may therefore change after the Skill package has been audited. The PDF conversion workflow compounds the issue by launching Chromium, loading the local report, allowing outbound access, waiting for network activity to become idle, and then waiting an additional two seconds specifically for the CDN resource. Escaping re ...[truncated 1552 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not load executable JavaScript from a CDN in generated reports. 2. Build the required Tailwind styles during development and package a static, reviewed CSS file with the Skill. 3. Prefer embedding the minimum required CSS directly in the generated HTML so reports are self-contained. 4. Disable network access during PDF generation, for example by intercepting and rejecting all non-`file:` requests. 5. Add a restrictive Content Security Policy that prohibits scripts and outbound connections, such as: ```html <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; script-src 'none'; connect-src 'none'"> ``` 6. If a remote asset is strictly unavoidable, use an immutable versioned asset, apply Subresource Integrity, and restrict it with an appropriate Content Security Policy. Static local CSS remains preferable. 7. Configure Playwright request routing to abort HTTP and HTTPS requests before loading the report. 8. Test report and PDF generation in an offline environment to ensure no external resource is required. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/data_tool.py:282
Finding
Undocumented Raw Cookie Transmission to an Inconsistently Documented API Host<![CDATA[ ## Vulnerability Details **File Location**: `scripts/data_tool.py:282-289`; command-line exposure at `scripts/data_tool.py:961-967` **Vulnerability Type**: Unnecessary and insufficiently documented transmission of authentication material **Risk Level**: Medium ### Vulnerable Code ```python def fetch_api(accounts, size=100, cookie=None, tenant_id="t221"): import urllib.request, urllib.error url = f"https://vms-service.tezign.com/datacenter/ai-insight/public/account-data?size={size}" body = json.dumps(accounts).encode('utf-8') headers = {"Content-Type":"application/json","x-tenant-id":tenant_id} if cookie: headers["Cookie"] = cookie req = urllib.request.Request(url, data=body, headers=headers, method="POST") try: with urllib.request.urlopen(req, timeout=30) as resp: data = json.loads(resp.read().decode('utf-8')) ``` The command-line interface accepts the raw cookie: ```python def add_data_args(p): g = p.add_argument_group('数据源') g.add_argument('--input','-i', default=None) g.add_argument('--accounts','-a', default=None) g.add_argument('--paste', default=None, help='可选:直接粘贴JSON/CSV/TSV/逐行文本数据') g.add_argument('--stdin', action='store_true', help='可选:从标准输入读取粘贴数据') p.add_argument('--size', type=int, default=100) p.add_argument('--cookie', default=None) p.add_argument('--tenant-id', default='tx_t1') ``` ### Technical Analysis The declared workflow describes the account-data endpoint as public and documents only the tenant identifier and content type. Nevertheless, the implementation accepts an arbitrary raw cookie and sends it verbatim to the API host. Raw cookies may contain session identifiers or authentication tokens with privileges broader than the public account-data operation. The code does not: - Restrict the permitted cookie name or scope - Verify that a cookie is required - Warn the user about credential disclosure - Use a narrowly scoped API token - Prevent cred ...[truncated 2175 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--cookie` option if the endpoint is genuinely public. 2. Confirm the canonical API hostname and make the implementation and documentation identical. 3. Enforce an allowlist containing the exact approved scheme, hostname, port, and path. 4. If authentication is required, replace raw cookies with a narrowly scoped API token specifically issued for read-only account-data access. 5. Accept credentials through a protected mechanism rather than command-line arguments, because command-line values may appear in shell history and process listings. 6. Clearly disclose the destination, data sent, authentication scope, and reason for transmission before any authenticated request. 7. Reject arbitrary cookie strings and limit any unavoidable credential to an explicitly supported name and format. 8. Ensure credentials are never logged, cached in run directories, included in generated reports, or placed in error messages. 9. Consider separating local-file analysis from network retrieval so local workflows operate without any network permission. 10. Add automated tests verifying that no authentication header is sent during public account-data requests. ]]>
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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
If the associated script truly performs HTML-to-PDF conversion with a browser runtime, that is a materially broader capability than simple content analysis and should be declared because browser rendering can introduce additional file access, network fetch, or sandbox escape risk. Even if used only for report export, the mismatch weakens user consent and security review accuracy.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
If the associated script truly performs HTML-to-PDF conversion with a browser runtime, that is a materially broader capability than simple content analysis and should be declared because browser rendering can introduce additional file access, network fetch, or sandbox escape risk. Even if used only for report export, the mismatch weakens user consent and security review accuracy.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file implements HTML-to-PDF generation rather than the social media title analysis described in the skill manifest, creating a capability mismatch. Such hidden or undocumented functionality is dangerous because it can process arbitrary local HTML through a browser engine, introducing file rendering and network-fetch behavior that users and reviewers would not expect from this skill. The mismatch makes the skill context more suspicious, since report rendering is adjacent support functionality at best and not clearly constrained to the declared purpose.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill documents capabilities that read local files, write artifacts, and call a remote API, but it declares no explicit tool scope or permissions boundary. That makes the effective privilege set ambiguous and increases the risk of overbroad access or accidental execution in environments that grant more capability than users expect.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The file mixes a few English trigger phrases with predominantly Chinese title, workflow, and instructions, effectively imposing a Chinese-language interaction model. There is no opt-in language choice or documented reason that the skill must operate only in Chinese, which fits the policy's language/locale violation criteria.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The workflow supports account analysis without uploaded files by sending account identifiers to a third-party API, but it does not prominently warn users that this data leaves the local environment. That omission undermines informed consent and can create privacy, compliance, or contractual issues depending on the accounts being analyzed.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill includes a network-capable `fetch_api` path that reaches out to an external service and accepts an optional session cookie, even though the skill is primarily framed as title analysis over uploaded or pasted data. That expands the trust boundary from local analytics to remote data collection and can cause undisclosed transmission of account identifiers and potentially sensitive authentication material.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The API request path can send account identifiers and an optional `Cookie` header to a remote service with no visible warning or consent mechanism in this file. This is dangerous because users may unknowingly transmit private account context or reusable session material beyond the local analysis boundary.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The tool persists uploaded, pasted, or fetched data to local cache and report files under a run directory without a clear warning. For analytics data that may contain account content, engagement metrics, or other sensitive business information, silent persistence increases the chance of unintended retention and later disclosure to other local users or processes.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
`cmd_compute` passes user-controlled input directly into `df.eval(expr)`, giving the skill an arbitrary expression-evaluation capability unrelated to normal title-insight analysis. Even if pandas limits some operations, this still materially broadens attack surface and can enable unexpected computation, access to unintended columns, denial-of-service through expensive expressions, or exploitation of parser/eval quirks in the execution environment.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The script loads a local HTML file in a real browser and waits for network activity to become idle, explicitly to allow a CDN resource to load. If the HTML is attacker-controlled or derived from untrusted data, this can trigger outbound requests, leak metadata/IP information, and allow remote content to influence PDF output. In the context of a social-media title analysis skill, this network-capable rendering behavior is unnecessary and increases risk because it expands the attack surface beyond the stated purpose.

Description-Behavior Mismatch

Low
Confidence
85% confidence
Finding
The skill instructs installation of Python packages into the host environment using pip with --break-system-packages, which modifies the runtime outside the skill's core analytic function. This can destabilize the host, introduce dependency-chain risk, and violate least-change expectations for a data-analysis skill.

Context-Inappropriate Capability

Low
Confidence
83% confidence
Finding
Host environment package installation is an unnecessary and risky expansion of capability for a skill whose stated role is analyzing social media titles and metrics. It increases supply-chain exposure and can enable unintended code execution via dependency install hooks or compromised packages.

Description-Behavior Mismatch

Low
Confidence
81% confidence
Finding
The generated HTML report loads Tailwind from a third-party CDN at render time, which creates an external network dependency not obvious from the skill description. Opening the report can leak access metadata such as IP, time, and user-agent to the CDN provider and introduces supply-chain risk if that dependency is unavailable or tampered with.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The report template hardcodes lang="zh-CN" and all user-facing report text is fixed in Chinese. The policy for all file types flags language/locale constraints when a skill forces a specific language without user opt-in or a documented justification.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/data_tool.py:937