Back to skill

Security audit

alimail

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for AliMail employee lookup, but it needs review because it can use company credentials to expose internal employee emails and IDs through broad or automatic searches.

Install only in an environment where AliMail directory lookup is authorized. Treat returned emails and employee numbers as internal data, require explicit lookup requests, avoid casual automatic name searches, and consider adding input validation, exact-match or minimum-length searches, rate limits, and pinned dependencies before deployment.

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
main.py:78
Finding
Unvalidated User Input Enables AliMail Directory Filter Manipulation## Vulnerability Details **File Location**: `main.py`, lines 78-85 **Vulnerability Type**: Filter injection through unescaped user input **Risk Level**: Medium ```python url = f"{self.base}/v2/users" params = {"filter": f"(name=*{name})", "size": 10} headers = {"Authorization": f"Bearer {token}"} try: res = requests.get(url, params=params, headers=headers, timeout=10) ``` ### Technical Analysis The externally supplied `name` argument is inserted directly into a structured AliMail filter expression: ```python f"(name=*{name})" ``` The code performs no validation or escaping of wildcard characters, parentheses, or other metacharacters recognized by the remote filter parser. Consequently, input such as a wildcard can broaden the search beyond a specific employee. Crafted delimiters may also alter the filter expression if the AliMail API accepts compound or nested filter syntax. URL encoding performed by `requests` does not prevent this issue because it only ensures safe HTTP transport; the remote API decodes the parameter before interpreting its filter syntax. ### Attack Path 1. An attacker or unauthorized caller gains access to the `search_alimail_user` Skill tool. 2. The attacker supplies a wildcard or crafted filter expression as the `name` parameter. 3. `main.py` embeds the value directly into the `filter` query parameter. 4. The request is authenticated using the configured AliMail service credential and sent to `/v2/users`. 5. The AliMail service evaluates the broadened or manipulated filter under the service account's permissions. 6. The Skill returns matching employee names, email addresses, employee numbers, and the overall match count. 7. Repeated requests may allow broader enumeration of the enterprise directory. ### Impact Assessment Successful exploitation may disclose internal employee directory information beyond the intended lookup, including names, email addresses, employee numbe ...[truncated 536 chars]
Remediation
## Remediation Suggestions 1. Validate the `name` parameter against a restrictive allowlist appropriate for employee names. Reject wildcard characters, parentheses, control characters, and filter operators. 2. Escape all filter metacharacters according to the official AliMail filter grammar before constructing the expression. 3. Prefer an AliMail API parameter that accepts a literal name rather than exposing raw filter syntax, if such an endpoint is available. 4. Enforce reasonable minimum and maximum input lengths to prevent broad one-character searches and resource abuse. 5. Consider exact matching by default and expose fuzzy matching only through a controlled server-side transformation. 6. Apply authorization and rate limiting at the Skill boundary to restrict directory searches to approved users and reduce enumeration risk. 7. Return only fields required by the caller. Avoid exposing `employeeNo` or the total match count unless operationally necessary. 8. Add tests covering wildcard-only input, parentheses, logical operators, malformed filters, empty input, and unusually long values.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented purpose understates the real behavior: the skill reads credentials from local configuration, authenticates to an external API, and queries internal employee directory data, while also claiming department info that is not actually reflected in the examples. This mismatch can mislead users and reviewers about the sensitivity of the action, increasing the risk of unauthorized internal data disclosure and improper trust in the skill.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill declares no explicit tool scope or permission boundaries even though it requires environment secrets, reads local configuration, and performs network access. In an agent environment, missing scope declarations reduce transparency and enforcement, making it easier for the skill to access sensitive credentials and query internal systems without clear user or platform-level constraints.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill lacks a clear warning that it accesses and reveals internal employee directory data such as corporate email and employee number. In this context, the missing disclosure is significant because the data is sensitive organizational information, and users may invoke the skill without understanding the privacy and access-control implications.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger guidance says the AI should automatically recognize and search for names mentioned by users, which is overly broad for a skill that reveals internal employee directory information. This can cause unintended invocation from casual conversation or ambiguous mentions, resulting in unnecessary disclosure of employee identifiers and email addresses without sufficiently explicit user intent.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill accesses client credentials and transmits them to an external service for OAuth token exchange, but there is no user-facing disclosure or consent flow indicating that secrets will be used and data will leave the local environment. In a plugin/agent context, undisclosed secret use and outbound network access are security-relevant because they can violate user expectations and organizational policy.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The manifest explicitly advertises lookup of internal employee email addresses and employee IDs, which are sensitive corporate directory attributes that can enable employee enumeration, phishing, impersonation, and privacy violations if exposed through an agent skill without clear authorization and user-facing safeguards. The skill context makes this more concerning because it is designed for internal personnel discovery and uses fuzzy name matching, increasing the likelihood of broad data disclosure beyond a narrowly justified need.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
The primary natural-language description and inline messaging are predominantly Chinese, which can amount to a language policy issue when the skill implicitly assumes a fixed language without offering user choice. There is no indication that Chinese is optional, selectable, or justified as a region-specific requirement.

Context-Inappropriate Capability

Low
Confidence
86% confidence
Finding
The skill reads API credentials from a local OpenClaw configuration file without that capability being clearly disclosed by its stated purpose. Accessing local configuration expands the skill's privilege surface and can surprise users, especially if the file contains other sensitive settings or if the skill is reused in environments with broader filesystem access.

Description-Behavior Mismatch

Low
Confidence
97% confidence
Finding
The manifest description explicitly claims the skill can quickly query internal employee email, employee number, and department information. In the actual response shaping logic, the code only returns name, email, and employeeNo, with no department field extracted or exposed.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The title, description, and parameter description all assume Chinese-language use, but the manifest does not indicate that the skill is region-specific or that users can opt into this locale. Under the policy, forcing a specific language without user choice or justification can be a natural-language policy issue.

Unpinned Dependencies

Low
Category
Supply Chain
Content
requests>=2.28.0
Confidence
92% confidence
Finding
The dependency is specified as `requests>=2.28.0`, which allows any newer release to be installed, making builds non-reproducible and preventing verification of exactly which code will run. In a security-sensitive skill that queries internal employee email, ID, and department information, this increases supply-chain risk because a vulnerable or compromised future version could be pulled in unnoticed.

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding
Because `requests` is not pinned, it is impossible to determine from this manifest whether installation will resolve to a version affected by known advisories or to a fixed release. Given this skill handles internal corporate directory data, any dependency weakness in HTTP handling could increase the risk of credential leakage, request manipulation, or exposure of sensitive internal information.

Static analysis

No suspicious patterns detected.