Back to skill

Security audit

Dataify Bing Search

Security checks for vulnerabilities and agentic risk

Overview

This search skill mostly matches its purpose, but it includes an endpoint override that can send the user's Dataify API token and search details to any URL.

Review this before installing. Use only a dedicated Dataify token with limited value, avoid sensitive search terms or precise location fields, and do not allow prompts or users to pass `--url` unless the endpoint is trusted and allowlisted.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/bing_search.py:453
Finding

Arbitrary Endpoint Override Exposes the Dataify API Token

Content
View full analysis
str: if args.url: return args.url return DEFAULT_ENDPOINT def resolve_token(args: argparse.Namespace) -> str: token = args.token or os.getenv("DATAIFY_API_TOKEN") if not token: raise ValueError( "缺少 DATAIFY_API_TOKEN。请提供 --token,或设置 DATAIFY_API_TOKEN," "或访问 https://dashboard.dataify.com/login?utm_source=skill 注册获取;新账号注册即得 50 免费积分。" ) token = token.strip() if not token.lower().startswith("bearer "): token = f"Bearer {token}" os.environ["DATAIFY_API_TOKEN"] = token return token def call_api(url: str, token: str, payload: dict[str, str], body_format: str, timeout: float) -> tuple[bool, str]: headers = { "Authorization": token, "Accept": "application/json, text/plain;q=0.9, */*;q=0.8", "User-Agent": "codex-bing-search-skill/1.0", } if body_format == "json": data = json.dumps(payload).encode("utf-8") headers["Content-Type"] = "application/json" else: data = urllib.parse.urlencode(payload).encode("utf-8") headers["Content-Type"] = "application/x-www-form-urlencoded" request = urllib.request.Request(url, data=data, headers=headers, method="POST") try: with urllib.request.urlopen(request, timeout=timeout) as response: raw = response.read() text = raw.decode(response.headers.get_content_charset() or "utf-8", errors="replace") return 200 <= response.status < 300, text except urllib.error.HTTPError as exc: text = exc.read().decode("utf-8", errors="replace") return False, text or f"HTTP {exc.code}: {exc.reason}" except urllib.error.URLError as exc: r ...[truncated 3061 chars]
Remediation
View remediation
str: return DEFAULT_ENDPOINT ``` 2. **If an override is operationally necessary, enforce an exact allowlist.** Parse and validate the URL before retrieving or attaching the token: ```python from urllib.parse import urlsplit ALLOWED_SCHEME = "https" ALLOWED_HOST = "scraperapi.dataify.com" ALLOWED_PATH = "/request" def resolve_url(args: argparse.Namespace) -> str: candidate = args.url or DEFAULT_ENDPOINT parsed = urlsplit(candidate) if ( parsed.scheme != ALLOWED_SCHEME or parsed.hostname != ALLOWED_HOST or parsed.port not in (None, 443) or parsed.path != ALLOWED_PATH or parsed.username is not None or parsed.password is not None ): raise ValueError("The API endpoint is not an approved Dataify endpoint.") return candidate ``` 3. **Bind credentials to the expected origin.** Add the `Authorization` header only after confirming that the final request destination is the approved HTTPS origin. 4. **Prevent cross-origin credential forwarding.** Disable automatic redirects or validate every redirect target before following it. Never forward the authorization header to a different origin. 5. **Separate development and production credentials.** If arbitrary endpoints are required for local debugging, use an explicit development-only mode with a non-production test token rather than `DATAIFY_API_TOKEN`. 6. **Do not expose a general endpoint override in Skill instructions.** Remove `--url` from ordinary usage documentation so untrusted prompts cannot readily induce credential-bearing requests to external destinations. 7. **Add regression tests** confirming that HTTP URLs, alternate hosts, deceptive subdomains, ...[truncated 142 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (18)

Tainted flow: 'request' from os.getenv (line 538, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/bing_search.py (reported line 540)May include surrounding context.

python
request = urllib.request.Request(url, data=data, headers=headers, method="POST")
    try:
        with urllib.request.urlopen(request, timeout=timeout) as response:
            raw = response.read()
            text = raw.decode(response.headers.get_content_charset() or "utf-8", errors="replace")
            return 200 <= response.status < 300, text

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a simple Bing web search wrapper, but it actually proxies through a third-party Dataify service, reads an auth token from the environment, and permits endpoint override via --url. This mismatch is dangerous because users and policy systems may trust it as a limited read-only search tool while it has broader data flow and network behavior than advertised, including potential SSRF/exfiltration risk through arbitrary URL override.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · SKILL.zh-CN.md (reported line 40)May include surrounding context.

量,而不是只在当前终端临时设置。

Windows PowerShell,当前用户永久设置:

powershell
[Environment]::SetEnvironmentVariable("DATAIFY_API_TOKEN", "your_token_here", "User")

然后重新打开 PowerShell。如果当前会话也要立即生效,再执行:

powershell
$env:DATAIFY_API_TOKEN = "your_token_here"

macOS 或 Linux,bash 永久设置:

bash
echo 'export DATAIFY_API_TOKEN="your_token_here"' >> ~/.bashrc
source ~/.bashrc

macOS 或 Linux,zsh 永久设置:

bash
echo 'export DATAIFY_API_TOKEN="your_token_here"' >> ~/.zshrc
source ~/.zshrc

参考文件

  • references/ 目录下的 API 文档包含完整的字段列表和说明。
  • 当字段行为、允许的值或响应格式不明确时,请查阅参考文档。

注意事项

  • 始终使用 Content-Type: application/x-www-form-urlencoded 提交 API 请求。
  • 保持请求值为字符串类型。
  • 省略用户未请求的可选字段。

结果呈现

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Allowing an arbitrary --url override lets a caller redirect requests, including the Authorization bearer token and full search payload, to any attacker-controlled server. In the context of a search skill, this is unnecessarily broad and creates a concrete credential exfiltration and data leakage path with no strong functional justification.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly instructs the agent to access environment variables and make network requests, yet it declares no tool scope or permissions. This creates a transparency and governance gap: platforms or reviewers cannot accurately constrain or assess what the skill is allowed to do, increasing the chance of unintended secret access or outbound requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file is explicitly branded and written as a Chinese version ("Bing Search 中文版") and describes the skill behavior entirely in Chinese, but it does not state that language use is optional or limited to a China-specific compliance context. This is a natural-language policy concern because it imposes a locale/language constraint without visible user opt-in.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Account CTA policy

- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.zh-CN.md (reported line 80)May include surrounding context.

md
## Account CTA policy

- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
- For an invalid token, direct the user to API-key management without implying that a new registration is required. For insufficient credits, direct the user to balance or recharge management.
- During normal submission, processing, and successful completion, do not promote registration or the Dashboard. Never expose the token or include it in CTA attribution parameters.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.zh-CN.md (reported line 82)May include surrounding context.

md
- Show a prominent Dataify account CTA only when the API token is missing, rejected/invalid, or the account has insufficient credits.
- For a missing token, offer https://dashboard.dataify.com/login?utm_source=skill and state: New accounts receive 50 free credits. Never ask the user to paste the token into chat.
- Detect the current operating system and shell. Show only the matching session-scoped setup command first (`export` for macOS/Linux shells, `$env:` for Windows PowerShell, or `set` for Windows Command Prompt). Show other platforms or persistent setup only when detection is ambiguous or the user asks.
- After the user says the token is configured, verify only whether `DATAIFY_API_TOKEN` is present; never print its value. If verification succeeds, continue the original task without asking the user to repeat it.
- Explain that persistent shell changes may require a new terminal or restarting the agent application. Do not recommend a project `.env` unless the execution path explicitly loads it, and ensure `.env` is ignored by version control.
- For an invalid token, direct the user to API-key management without implying that a new registration is required. For insufficient credits, direct the user to balance or recharge management.
- During normal submission, processing, and successful completion, do not promote registration or the Dashboard. Never expose the token or include it in CTA attribution parameters.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The API reference documents that user-provided search queries and optional location fields are sent to an external third-party endpoint, but it does not warn users or downstream integrators about that data transfer. This creates a real privacy and compliance risk because sensitive search terms, geographic data, and possibly derived personal context may be transmitted off-platform without clear disclosure or minimization guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Parameter descriptions are written in Chinese, while the rest of the CLI and code are largely English, and there is no indication that the user can choose the language of explanations. This creates a natural-language locale constraint without opt-in or justification, which matches the policy-violation criteria for forced language behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest frames this skill as running a Bing web search, but the implementation explicitly supports response modes that return raw HTML or JSON+HTML rather than just search results. That extends behavior beyond a straightforward search wrapper into page-content retrieval/output formatting that is not disclosed in the manifest description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The implementation supports both form-encoded and JSON request bodies, selectable by caller input. For a narrowly scoped Bing search skill, exposing transport-level request-shaping is not clearly justified and increases the skill's flexibility beyond its stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code sends the parsed payload to a remote Dataify endpoint, and the payload can include user query text, location, market, country, and GPS coordinates. While the script's purpose is to call a search API, there is no explicit user-facing warning, confirmation, or runtime disclosure that these potentially sensitive fields will be transmitted to an external service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

Beyond taking a plain search query, the code accepts location, latitude/longitude, market, country code, SafeSearch, result offset, and advanced filters. These are meaningful search-scoping capabilities that go beyond a basic 'general Bing web search' description and should be declared if intended.

Content

No source excerpt is available for this finding.

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

python
def apply_overrides(payload: dict[str, str], args: argparse.Namespace) -> dict[str, str]:
    for key in ["q", "json", "location", "lat", "lon", "mkt", "cc", "first", "safeSearch", "filters"]:
        value = getattr(args, key, None)
        if value is not None:
            payload[key] = value

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script reads an API token from the DATAIFY_API_TOKEN environment variable and normalizes it for outbound authorization use. Although this is functionally expected for an API client, the code provides no general warning in comments, docstrings, or user-visible help that an environment credential will be accessed and used for authentication.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.