Back to skill

Security audit

Smart Message Plus

Security checks for vulnerabilities and agentic risk

Overview

This is a real enterprise messaging skill, but it needs Review because some paths can disclose message content, local files, or webhook secrets beyond the intended scope.

Install only if you trust the operator and workspace, and configure it with least-privilege enterprise app scopes. Prefer storing WeCom groups as bare keys or validated official webhook URLs, avoid untrusted aliases/templates, do not point custom org lookup at non-HTTPS or untrusted services, and treat send logs as sensitive because they may contain message previews, recipient data, and webhook secrets.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/providers/wecom.py:59
Finding

Unrestricted WeCom webhook destinations allow outbound disclosure of messages and local images

Content
View full analysis
tuple[bool, str, dict]: st, r = request(url, body, timeout=self.timeout) code = r.get("errcode", -1) if st == 200 and code == 0: return True, "", r ``` ```python with open(path, "rb") as f: data = f.read() body = {"msgtype": "image", "image": { "base64": base64.b64encode(data).decode(), "md5": hashlib.md5(data).hexdigest(), }} good, err, _ = self._post(url, body) ``` ### Technical Analysis The WeCom provider accepts any destination beginning with `http://` or `https://`. It does not verify that the destination uses HTTPS, belongs to `qyapi.weixin.qq.com`, uses the expected webhook path, or contains a valid WeCom webhook key. Messages and user-selected local images are subsequently transmitted to this unrestricted destination. Images are read into memory and Base64-encoded before transmission. Base64 encoding is required by the legitimate WeCom image webhook protocol and is not intrinsically covert or malicious. The vulnerability arises because the encoded file content can be sent to an arbitrary HTTP endpoint rather than being restricted to the intended WeCom service. The HTTP helper also uses standard redirect handling without an explicit same-origin policy, so destination validation must cover both the initial request and redirects. ### Attack Path 1. An attacker causes a malicious URL to be supplied as `--chat-id`, stored as a WeCom group alias, or configured as the account's default webhook. 2. The user or Agent invokes a ...[truncated 1019 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/core/templates.py:15
Finding

Template name path traversal can read and transmit files outside the template directory

Content
View full analysis
str: p = template_dir() / f"{name}.txt" if not p.exists(): available = [f.stem for f in template_dir().glob("*.txt")] hint = f"Available templates: {', '.join(available)}" if available else "No templates available" raise ValueError(f"Template does not exist: {name}") text = p.read_text(encoding="utf-8") ``` The security-relevant source operations are: ```python p = template_dir() / f"{name}.txt" text = p.read_text(encoding="utf-8") ``` ### Technical Analysis The template name is directly incorporated into a filesystem path without restricting it to a basename or verifying the resolved path. A value containing `../` components can escape the configured template directory. An absolute path can also replace the base directory under normal `pathlib` path-composition behavior. The implementation appends `.txt`, so the target must have a corresponding `.txt` name. If such a file exists and is readable by the process, its contents are loaded as message text. The normal send flow can then transmit those contents through DingTalk, Feishu, or WeCom. ### Attack Path 1. An attacker influences the `--template` argument. 2. The attacker supplies traversal input such as `../../sensitive/location/secret`. 3. The code constructs a path equivalent to `templates/../../sensitive/location/secret.txt`. 4. `Path.read_text()` reads the file outside the intended template directory. 5. The returned content becomes the outgoing message body. 6. The message is transmitted to the destination selected for the send operation. ### Impact Assessment Successful exploitation can disclose any readable `.txt` file reachable by the process, including: - Workspace notes or exported data. - Text configurati ...[truncated 368 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/providers/org_lookup.py:17
Finding

Custom organization lookup can transmit authorization credentials over untrusted or plaintext endpoints

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/core/sendlog.py:29
Finding

Send logs and contact listings can expose message content, recipient identifiers, and WeCom webhook secrets

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (40)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill description presents broader WeCom capabilities than are actually implemented, including P2P messaging, recall, department broadcast, and contact/address-book style behavior that webhook mode cannot support. This can cause an agent or operator to rely on safeguards or channel semantics that do not exist for that provider, leading to misdelivery, failed controls, or unsafe assumptions about what actions are possible.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description presents broader WeCom capabilities than are actually implemented, including P2P messaging, recall, department broadcast, and contact/address-book style behavior that webhook mode cannot support. This can cause an agent or operator to rely on safeguards or channel semantics that do not exist for that provider, leading to misdelivery, failed controls, or unsafe assumptions about what actions are possible.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 65)May include surrounding context.

md
## Safety notes

- **Message content must come from the user.** The CLI is a transport; AI agents must never draft outbound messages autonomously.
- Credentials live outside the skill directory (`$SMP_DATA_DIR` > `<workspace>/.smart-message/` > `~/.smart-message/`), chmod 600.
- Broadcasts above configurable thresholds require `--force-send` or an admin-issued approval code.

## License

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/core/config.py (reported line 72)May include surrounding context.

python
## Safety notes

- **Message content must come from the user.** The CLI is a transport; AI agents must never draft outbound messages autonomously.
- Credentials live outside the skill directory (`$SMP_DATA_DIR` > `<workspace>/.smart-message/` > `~/.smart-message/`), chmod 600.
- Broadcasts above configurable thresholds require `--force-send` or an admin-issued approval code.

## License

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill exposes capabilities that imply shell, filesystem, environment, and network access but does not declare any tool scope or permission boundaries. In an agent environment, this increases the risk of over-broad execution, unintended data access, or message-sending actions occurring with more privilege than users or reviewers expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill content is effectively Chinese-only, including the title and operational instructions, with no indication that users may choose another language. This can violate language/locale policy when a skill forces one language without user opt-in or explicit justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This file persists account credentials and cached tokens via save_json(..., secret=True), including app secrets and access tokens. Although the code marks them as secret, there is no confirmation prompt, log message, or docstring in this file warning users that sensitive authentication material will be stored on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

remove_account deletes the selected account entry and then drops its cached token, which is a destructive local data change. In this file there is no confirmation prompt, warning message, or explanatory docstring indicating that removal is irreversible for the stored account configuration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing exception messages entirely in Chinese, including operational instructions the user must follow. The policy for this audit flags language or locale constraints when a skill forces a specific language without offering choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code persistently logs message metadata including provider, account, message ID, target, chat ID, timestamp, and a preview of message content to a JSONL file without any indication here of user consent, minimization, retention controls beyond entry count, or access protection. In a messaging skill, this is privacy-sensitive because logs can reveal who was contacted, when, and partial message contents, and could be exposed to other local users, backups, or later compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The broadcast audit log stores a preview of the message and a sample of recipients for large sends, which creates a durable record of sensitive communication content and recipient relationships. In the context of an enterprise cross-platform messaging tool, this increases privacy and confidentiality risk because broadcast activity may involve internal organizational data, contact lists, or sensitive announcements.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/providers/dingtalk.py (reported line 5)May include surrounding context.

python
"""smart-message-plus: DingTalk adapter (enterprise internal app + robot).

Verified endpoints (e2e tested 2026-07-14):
  token      POST https://api.dingtalk.com/v1.0/oauth2/accessToken
  p2p send   POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
  group send POST https://api.dingtalk.com/v1.0/robot/groupMessages/send
  p2p recall POST https://api.dingtalk.com/v1.0/robot/otoMessages/batchRecall

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/providers/dingtalk.py (reported line 6)May include surrounding context.

python
"""smart-message-plus: DingTalk adapter (enterprise internal app + robot).

Verified endpoints (e2e tested 2026-07-14):
  token      POST https://api.dingtalk.com/v1.0/oauth2/accessToken
  p2p send   POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
  group send POST https://api.dingtalk.com/v1.0/robot/groupMessages/send
  p2p recall POST https://api.dingtalk.com/v1.0/robot/otoMessages/batchRecall

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/providers/dingtalk.py (reported line 7)May include surrounding context.

python
"""smart-message-plus: DingTalk adapter (enterprise internal app + robot).

Verified endpoints (e2e tested 2026-07-14):
  token      POST https://api.dingtalk.com/v1.0/oauth2/accessToken
  p2p send   POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
  group send POST https://api.dingtalk.com/v1.0/robot/groupMessages/send
  p2p recall POST https://api.dingtalk.com/v1.0/robot/otoMessages/batchRecall

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/providers/dingtalk.py (reported line 8)May include surrounding context.

python
"""smart-message-plus: DingTalk adapter (enterprise internal app + robot).

Verified endpoints (e2e tested 2026-07-14):
  token      POST https://api.dingtalk.com/v1.0/oauth2/accessToken
  p2p send   POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
  group send POST https://api.dingtalk.com/v1.0/robot/groupMessages/send
  p2p recall POST https://api.dingtalk.com/v1.0/robot/otoMessages/batchRecall

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/providers/dingtalk.py (reported line 9)May include surrounding context.

python
"""smart-message-plus: DingTalk adapter (enterprise internal app + robot).

Verified endpoints (e2e tested 2026-07-14):
  token      POST https://api.dingtalk.com/v1.0/oauth2/accessToken
  p2p send   POST https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
  group send POST https://api.dingtalk.com/v1.0/robot/groupMessages/send
  p2p recall POST https://api.dingtalk.com/v1.0/robot/otoMessages/batchRecall

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code returns user-facing status and error text in Chinese, for example when token retrieval fails. The file consistently uses Chinese-only natural-language strings and does not provide any opt-in, locale selection, or documented region-specific justification, which violates the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code documents that legacy app-channel chat messages cannot be recalled, but the generic recall path does not clearly prevent attempts to recall such messages. This inconsistency can cause operators to falsely believe sensitive messages were withdrawn when they were not, creating a security and privacy risk through failed remediation rather than direct compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The adapter exposes organization lookup and group-creation capabilities that go beyond simple message delivery and enable enumeration of departments and bulk member IDs. In a messaging skill, this broadens the reachable data surface and can be abused for internal directory harvesting or wider-than-intended broadcast targeting if higher-level authorization or consent checks are weak.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes a cross-platform messaging CLI for sending messages, recalls, templates, aliases, multi-account management, department broadcast, and safety gating. This file also creates new Feishu chats and lists all chats, which are administrative/group-management operations not described in the manifest text for Feishu usage and go beyond straightforward message delivery.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The provider reads arbitrary local files from disk and uploads their contents to remote Feishu endpoints via multipart HTTP requests. Although this behavior is functionally expected for a messaging adapter, this code path has no visible confirmation prompt, user-facing log/print, or inline warning/comment disclosing that local file contents will be transmitted off-host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The raised error strings are written only in Chinese, which imposes a specific language on users without any opt-in or fallback. This is a natural-language policy issue because the file does not offer language selection or document a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

These runtime and validation error messages are emitted only in Chinese, again forcing a locale choice on users without opt-in. Because the file contains no mechanism for language selection or justification for a Chinese-only audience, this violates the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The function reads a local file and transmits it to WeCom using multipart_upload and a subsequent webhook message send. Although this behavior is central to the feature, the code path contains no confirmation prompt, print/log message, or inline warning that local file contents will be sent to an external service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest frames the skill as a cross-platform messaging CLI focused on sending, recall, templates, aliases, account management, department broadcast, and safety gating. This file also supports creating new groups and listing existing groups, which are administrative collaboration-management actions not disclosed in the stated description.

Content

No source excerpt is available for this finding.