Back to skill

Security audit

media-search

Security checks for vulnerabilities and agentic risk

Overview

This media-search skill is mostly purpose-aligned, but it handles API credentials and tokens with unsafe transport, logging, and local persistence practices that users should review before installing.

Install only if you trust the media API integration and can accept local token/result storage. Before production use, enable normal TLS certificate verification, stop logging token-bearing headers, enforce owner-only permissions for the token cache, and narrow activation to explicit user-directed media searches.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/token_manager.py:204
Finding

TLS Certificate Verification Disabled for Credential and Token Traffic

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/media_search.py:199
Finding

Bearer Access Token Exposed in INFO-Level Logs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/token_manager.py:130
Finding

Persisted Bearer Token File Does Not Enforce Restrictive Permissions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (35)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented purpose is media/news search, but the detected behavior includes credential reading, token acquisition, and local persistence/locking that are not clearly tied to user-visible search functionality. Description-behavior mismatch is dangerous because it can hide sensitive operations behind a benign-looking skill, reducing operator scrutiny and enabling secret handling or remote access beyond user expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger conditions are extremely broad, covering common phrases like '查一下' or '搜一下' that overlap with ordinary conversation. Overbroad activation can cause the skill to run in unintended contexts, leading to unnecessary network access, secret usage, data retention, or disclosure of search results when the user did not clearly request this specific capability.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The skill includes shell-based file deletion guidance (rm sources/result.json) as part of routine workflow. Even though the example uses a fixed path, normalizing deletion as a follow-up action in a skill that handles file paths raises the risk of unsafe command construction or path manipulation in downstream implementations, especially if future variants substitute user-controlled paths.

Content

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

python3 search.py --json-input '{"keywords": "test"}' --output-file sources/result.json

使用结果后,如不再需要则清理

rm sources/result.json # 删除临时JSON文件

text

## Examples

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The request sends both search content and the API token over HTTPS while explicitly disabling certificate verification with verify=False. That makes the connection vulnerable to man-in-the-middle interception or impersonation, allowing an attacker on the network path to capture tokens, read search queries, or tamper with responses. Because this skill handles potentially sensitive research and monitoring queries, the disabled TLS verification is especially risky.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module suppresses insecure-request warnings and elsewhere performs HTTPS requests with certificate verification disabled, creating a silent trust bypass. This allows man-in-the-middle interception of API credentials and tokens without operators seeing the normal warning signals, which is especially dangerous in an authentication component.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The request sends appid and secret over HTTPS with verify=False, meaning the client does not authenticate the server certificate. An attacker positioned on the network could impersonate the API endpoint, capture credentials, and issue or replay tokens, compromising downstream media-platform access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Automatically saving all search queries and results to local files without a prominent warning creates privacy and confidentiality risk. Search terms and collected articles may reveal internal investigations, competitive monitoring, or sensitive subjects, and local markdown files can later be accessed by other users, tools, or backup systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Persisting authentication tokens on disk without a prominent warning can expose long-lived or refreshable credentials to local compromise, backups, or accidental sharing. Even with restrictive file permissions, users should be clearly informed because disk persistence changes the threat model compared with in-memory-only authentication.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Disabling HTTPS certificate verification by default undermines transport security and can allow man-in-the-middle interception or tampering of API requests and responses, including credentials and returned media data. This is especially risky for a tool that fetches remote content and uses authenticated API access.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill documentation describes capabilities that require network access, environment-variable secret access, and file write/read behavior, but it does not declare any tool scope or permission boundaries. In an agent environment, this weakens least-privilege controls and makes it easier for the skill to access secrets, persist data locally, or exfiltrate content without explicit policy review.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

该文件的描述与使用说明整体以中文固定表达技能适用方式,但未说明这是仅面向特定中文业务场景的受限技能,也未给出语言选择或用户确认。按照语言/locale 政策,强制单一语言而无 opt-in 可能构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill documents automatic saving and detailed console output of search results but does not warn about the privacy and confidentiality risks of persisting or displaying potentially sensitive queries and retrieved content. In an agent setting, this can expose research topics, sources, or retrieved data to local storage, logs, or later consumers without user awareness.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The integration notes claim '所有搜索结果自动保存到sources文件夹' and '支持JSON文件、控制台、Markdown三种输出', but earlier usage and output sections say file saving happens only when --output-file is specified and describe only JSON and console output. This is an active documentation contradiction about whether persistence is automatic and whether Markdown output exists.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The module docstring and command-line help strings are written exclusively in Chinese, which effectively fixes the skill's interaction language without indicating that the user can choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code logs the full request headers, which include the authentication token. Any user or service with access to application logs could recover that token and reuse it to access the upstream media API, causing credential leakage outside the skill's intended purpose. In this skill context, tokens protect access to an external media-search backend, so exposing them materially increases the risk of unauthorized API use and data access.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

Using verify=False disables server certificate validation, defeating a core HTTPS security control. An attacker could present a forged certificate, intercept the token and query contents, or alter API responses without being detected. In a networked search skill that depends on a remote authenticated service, this unsafe default meaningfully increases exposure.

Content

Scanner excerpt · scripts/media_search.py (reported line 217)May include surrounding context.

python
data=encoded_data,
                headers=headers,
                timeout=timeout,
                verify=False,
            )
            response.raise_for_status()

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module docstring and user-facing messages are presented in Chinese, and the file does not indicate that this language choice is optional or required by a region-specific constraint. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes using the skill for web-wide media article retrieval, event background lookup, and related research tasks. This file creates and manages a local .mbd_token_cache.json file and later deletes it, introducing filesystem persistence/cleanup behavior that is not reflected in the manifest's user-facing description.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
99% confidence
Finding

Using verify=False establishes an unsafe default in a component that handles secrets and bearer tokens. Because token acquisition is foundational to all later API access, compromise here can enable credential theft, unauthorized API usage, and exposure of sensitive platform data.

Content

Scanner excerpt · scripts/token_manager.py (reported line 211)May include surrounding context.

python
data=urllib.parse.urlencode(data),
                headers=headers,
                timeout=30,
                verify=False,
            )
            response.raise_for_status()
            result = response.json()

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes a skill for media/news search and background research, but this file implements credential handling by reading NEWS_BIGDATA_API_KEY and NEWS_BIGDATA_API_SECRET from environment variables. Accessing process environment secrets is a separate capability from performing media retrieval and is not explicitly justified by the stated purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring presents the tool entirely in Chinese, and the command-line descriptions, examples, and runtime messages are also Chinese-only throughout the file. This creates a natural-language locale constraint without any opt-in or indication that the skill is intentionally limited to a Chinese-language environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is described as a media search tool, but it also persistently stores full search results, including summaries and article content, into a local sources directory. This creates an unnecessary data retention surface that can expose sensitive research topics, copyrighted material, or internal investigation context to other local users, later processes, or unintended uploads.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The --output-file argument allows writing results to an arbitrary path supplied by the caller, which exceeds the narrow search-only purpose of the skill and enables file write side effects. In an agent context, this can be abused to overwrite or plant files in sensitive locations accessible to the process, potentially altering local state, poisoning downstream workflows, or causing data leakage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README content is wholly Chinese-language and does not indicate that the skill supports multiple languages or that use is intentionally limited to a Chinese-speaking or region-specific context. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README shows that the skill does more than simple media search: it persistently stores authentication material and automatically writes search outputs to disk. In a research or newsroom workflow, queries and results may contain sensitive investigative topics, and silent retention increases the chance of local disclosure, over-collection, or unintended reuse.

Content

No source excerpt is available for this finding.