Back to skill

Security audit

Datayes Web Search

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Datayes search skill, but it needs review because a redirect could leak the Datayes bearer token outside the intended Datayes host allowlist.

Review before installing. Use only a revocable, least-privilege Datayes token, avoid highly sensitive queries until redirect handling is fixed, and prefer a version that disables redirects or revalidates every redirect before sending Authorization headers.

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

Warning
Location
scripts/datayes_web_search.py:60
Finding

Bearer Token May Be Disclosed Through Unvalidated HTTP Redirects

Content
View full analysis
Any: body = None headers = { "Authorization": f"Bearer {get_token()}", "Accept": "application/json", "User-Agent": "datayes-web-search-skill/1.0", } if payload is not None: body = json.dumps(payload, ensure_ascii=False).encode("utf-8") headers["Content-Type"] = "application/json" req = Request(url=url, data=body, headers=headers, method=method) try: with urlopen(req, timeout=DEFAULT_TIMEOUT) as resp: return json.load(resp) ``` ### Technical Analysis The implementation validates the original API URL against an HTTPS host allowlist before calling `request_json`. However, `urllib.request.urlopen` follows supported HTTP redirects automatically, and the code does not validate each redirect destination. The original request contains the sensitive `DATAYES_TOKEN` in an `Authorization: Bearer` header. A redirect request may retain request headers, including authorization data, while some redirect status codes can also preserve the HTTP method and request body. Consequently, validation of only the initial URL does not guarantee that the token and user query remain confined to an approved Datayes host. Exploitation requires a trusted Datayes endpoint, or infrastructure controlling its response path, to issue a redirect to an attacker-controlled destination. There is no evidence in the audited project that it can independently cause such a redirect, so this is a defensive coding weakness rather than evidence of intentional exfiltration. ### Attack Path 1. A user invokes the Skill with a valid `DATAYES_TOKEN` and a search query. 2. The script validate ...[truncated 1213 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill requires both environment access to a bearer token and network access, but it does not declare an explicit tool/permission scope such as allowed tools or network restrictions. In an agent setting, this weakens least-privilege controls and can allow the skill to invoke code and transmit sensitive data without clear policy boundaries, increasing the risk of token misuse or unintended outbound requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The description is written as an instruction that the skill should be used and operated in Chinese, and the file provides no opt-in or alternative language behavior. This can violate language/locale policy when a skill effectively forces one language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This Python code reads the sensitive DATAYES_TOKEN environment variable and uses it to authenticate outbound HTTPS requests, but there is no confirmation prompt, warning comment, or user-facing notice about credential use or data transmission. For code files, accessing sensitive environment variables and making network calls should include some visible disclosure unless clearly documented elsewhere in-scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.