Back to skill

Security audit

Alibabacloud Sls Data Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent SLS data-analysis purpose, but it can send signed Alibaba Cloud requests and sensitive log-analysis context to a user-configurable endpoint without enforcing trusted destinations.

Review this skill before installing. Use only least-privilege Alibaba Cloud credentials, avoid broad digitalemployee wildcards, do not include secrets or unnecessary personal data in questions, and do not set SLS_DATA_AGENT_ENDPOINT unless it is a verified Alibaba Cloud service endpoint. The publisher should add endpoint allowlisting, escape routing markup fields, clarify STAROps/SLS permission documentation, and update the requests dependency.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/call_sls_data_agent.py:227
Finding
Arbitrary API Endpoint Receives Signed Requests and Sensitive SLS Context<![CDATA[ ## Vulnerability Details **File Location**: `scripts/call_sls_data_agent.py:227, 312-324, 349-352, 398-405` **Vulnerability Type**: Unrestricted authenticated endpoint override **Risk Level**: High ### Complete Code Snippet ```python endpoint = os.environ.get("SLS_DATA_AGENT_ENDPOINT") or DEFAULT_ENDPOINT ``` ```python def sign_request(self, request: SignatureRequest) -> SignatureRequest: credential = self._get_current_credential() access_key_id = call_or_none(credential, "get_access_key_id") access_key_secret = call_or_none(credential, "get_access_key_secret") security_token = call_or_none(credential, "get_security_token") if security_token: request.headers["x-acs-security-token"] = security_token canonical_request, signed_headers = build_canonical_request(request) hashed_canonical_request = sha256_hex(canonical_request.encode("utf-8")) string_to_sign = f"{ALGORITHM}\n{hashed_canonical_request}" signature = hmac.new( str(access_key_secret).encode("utf-8"), string_to_sign.encode("utf-8"), hashlib.sha256, ).hexdigest().lower() request.headers["Authorization"] = ( f"{ALGORITHM} Credential={access_key_id}," f"SignedHeaders={signed_headers},Signature={signature}" ) return request ``` ```python query_string = canonicalize_query(request.query) url = f"https://{self.host}{path}" + (f"?{query_string}" if query_string else "") try: response = self.transport( request.method, url, headers=dict(request.headers), data=request.body if request.method != "GET" else None, timeout=30, ) ``` ```python url = f"https://{self.host}{path}" try: try: response = self.transport( request.method, url, headers=dict(request.headers), data=request.body, timeout=self._request_timeout(), stream=True, ) ``` ### Technical Analysis The API en ...[truncated 2707 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict production endpoints to exact approved service hostnames, such as `starops.<region>.aliyuncs.com`. 2. Normalize and validate the hostname before credential resolution or request signing: - Reject schemes, paths, query strings, ports, user-information components, IP literals, and malformed DNS names. - Do not rely on a simple suffix check that could accept names such as `aliyuncs.com.attacker.example`. 3. Maintain an explicit allowlist of supported Alibaba Cloud endpoints or derive the endpoint from a validated region. 4. If custom endpoints are required for testing, require an explicit unsafe-development flag and refuse to attach production credentials by default. 5. Separate endpoint configuration from credential policy so arbitrary endpoints can only use dedicated test credentials. 6. Warn users before transmitting project, logstore, or question content to a nonstandard endpoint. 7. Avoid returning raw untrusted endpoint responses as authoritative analysis without recording and clearly displaying the endpoint identity. ]]>

T01 · Skill Instruction Hijacking

Warning
Location
scripts/call_sls_data_agent.py:464
Finding
Unescaped Configuration Values Allow DataAgent Routing-Markup Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/call_sls_data_agent.py:464-479` **Vulnerability Type**: Structured prompt and routing-markup injection **Risk Level**: Medium ### Complete Code Snippet ```python def build_message_value(self, question: str) -> str: """Build the message value with optional vibeops skill and logstore tags.""" parts: list[str] = [] if self.config.skill: skill_id = self.config.skill if not skill_id.startswith("skills."): skill_id = f"skills.{skill_id}" parts.append( f'<code vibeops_object type="vibeops-skill"><skill id="{skill_id}"/></code>' ) if self.config.logstore: parts.append( f'<code vibeops_object type="logstore">' f'<logstore name="{self.config.logstore}" ' f'project="{self.config.project}" ' f'region="{self.config.region}" />' f'</code>' ) parts.append(question) return " ".join(parts) ``` ### Technical Analysis The Skill constructs trusted DataAgent routing markup by directly interpolating values controlled through command-line arguments or environment variables: - `--skill` or `SLS_DATA_AGENT_SKILL` - `--logstore` or `SLS_DATA_AGENT_LOGSTORE` - `--project` or `SLS_DATA_AGENT_PROJECT` - `SLS_DATA_AGENT_REGION` These values are inserted into quoted markup attributes without XML escaping or restrictive format validation. A value containing quotation marks, closing tags, or additional markup can terminate its intended attribute and introduce attacker-controlled routing objects or instructions. For example, a malicious logstore value could contain a quote followed by a closing element and another `vibeops_object`. Because the resulting string is sent as the user message's `value`, the remote agent may interpret the injected structure as trusted skill or logstore routing metadata rather than ordinary user text. The vulnerability is distinct from normal n ...[truncated 1559 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Escape every value inserted into markup attributes using a standards-compliant XML escaping function. 2. Apply strict allowlists before constructing the message: - Permit only the documented built-in skill IDs. - Restrict project, region, and logstore names to their documented Alibaba Cloud character sets and lengths. - Reject quotation marks, angle brackets, control characters, and malformed Unicode. 3. Prefer a typed JSON request field for skill and logstore routing instead of embedding control objects in natural-language text. 4. If the backend requires markup, construct it with an XML library rather than string interpolation. 5. Keep routing metadata separate from the user's natural-language question and ensure the backend treats the question exclusively as data. 6. Add tests using values containing `"`, `'`, `<`, `>`, `&`, closing tags, nested tags, and duplicate routing objects to verify that injection cannot change the generated structure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (10)

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The RAM policy notes are for a different product and permission model than the declared SLS DataAgent skill. This mismatch can cause operators to grant `cms:CreateThread` and `cms:CreateChat` to a skill that users believe performs SLS analysis, obscuring the real trust boundary and enabling unintended access to another agent service.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The documented security boundary says the skill creates STAROps investigation threads and streams agent answers rather than performing SLS data analysis. Security-boundary text defines operator expectations; when it describes a different capability, users may authorize or trust behavior they did not intend, creating a confused-deputy risk and masking access to a separate service.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Content
, "text", "value", "answer"):
        value = message.get(field)
        if isinstance(value, str) and value.strip():
            parts.append(value.strip())
    items = message.get("items")
    if isinstance(items, list):
        parts.extend(extract_text_parts(items))
    contents = message.get("contents")
    if isinstance(contents, list):
        parts.extend(extract_text_parts(contents))
    tools = message.get("tools")
    if isinstance(tools, list):
        parts.extend(extract_text_tool_parts(tools))
    return "\n".join(dedupe_preserve_order(parts)).strip()


def extract_tool_records(message: Mapping[str, Any]) -> list[ToolRecord]:
    raw_tools: list[Any] = []
    tools = message.get("tools")
    if isinstance(tools, list):
        raw_tools.extend(tools)

    items = message.get("items")
    if isinstance(items, list):
        for item in items:
            if isinstance(item, dict) and isinstance(item.get("tools"), list):
                raw_tools.extend(item["tools"])
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill invokes external networked APIs and relies on environment-provided cloud credentials, yet it declares no explicit tool scope or permission boundary. That makes the capability surface implicit rather than reviewable, increasing the risk of unintended credential use or unauthorized outbound access when the skill is enabled.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
---
name: alibabacloud-sls-data-agent
description: |
  Invoke SLS DataAgent to autonomously perform data acquisition, processing, analysis, and visualization for Alibaba Cloud SLS (Simple Log Service). Acts as a fully automated data analyst — ask a question in natural language, get structured conclusions and charts.
  Use when the user asks about: 数据分析, 取数, 数据查询, 日志分析, SLS, 可视化, 图表, 数据洞察, data analysis, DataAgent, 全自动数据分析师.
---
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.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill description does not clearly warn users that their natural-language prompts are sent to an external Alibaba Cloud service and may trigger automated retrieval and analysis of project/logstore data. This creates a meaningful data governance and privacy risk because users may provide sensitive prompts or authorize analysis without understanding the external transmission and automated access behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The documentation shows that arbitrary user-supplied message content, plus project/logstore/region metadata, is sent to a remote Alibaba Cloud API and streamed back, but it does not prominently warn about privacy, data handling, or the risk of transmitting sensitive operational data off-tool. In a data-analysis skill for logs, users may naturally include secrets, PII, incident details, or proprietary telemetry, so lack of explicit disclosure and guidance can lead to unintended data exposure.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
The statement about not using STAROps-specific credentials conflicts with the skill's SLS DataAgent identity and reinforces that the file was copied from unrelated STAROps documentation. Contradictory credential guidance can mislead deployers about what identities are being used, increasing the chance of misconfiguration, overbroad credential exposure, or accidental connection to the wrong backend service.

Known Vulnerable Dependency: requests==2.32.4 — 2 advisory(ies): CVE-2026-25645 (Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility func); CVE-2026-25645 (Requests is a HTTP library. Prior to version 2.33.0, the `requests.utils.extract)

Medium
Category
Supply Chain
Confidence
92% confidence
Finding
The pinned dependency uses requests==2.32.4, which is flagged by the scanner as affected by a known vulnerability fixed in 2.33.0. Even though the issue appears tied to a specific utility path in the library, keeping a known-vulnerable version pinned is unsafe because agent skills often process external data and may indirectly exercise vulnerable code paths through current or future integrations.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Content
def call_or_none(obj: Any, method_name: str) -> Any:
    method = getattr(obj, method_name, None)
    if method is None:
        return None
    return method()
Confidence
50% confidence
Finding
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/api-reference.md:29