Back to skill

Security audit

Huo15 Dingtalk Connector Pro

Security checks for vulnerabilities and agentic risk

Overview

This DingTalk connector is purpose-aligned overall, but it grants broad message-to-agent authority and can automatically upload readable local files when paths appear in agent output.

Install only if you will configure allowlists or disabled group access, avoid the unsupported pairing mode, restrict which agents/tools this channel can reach, and do not run the beta installer unless you verify the exact commit yourself. Treat this connector as able to transmit DingTalk messages, attachments, AI responses, and in some cases local files readable by the OpenClaw process.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
src/services/media.ts:1022
Finding
Arbitrary Local File Disclosure Through Agent-Generated Paths<![CDATA[ ## Vulnerability Details **File Location**: `src/services/media.ts:1022-1109`; `src/services/media/common.ts:65-137`; callers at `src/core/message-handler.ts:1507-1508` and `src/reply-dispatcher.ts:328-330` **Vulnerability Type**: Arbitrary local file read and upload **Risk Level**: High ### Vulnerable Code ```ts export async function processRawMediaPaths( content: string, config: DingtalkConfig, oapiToken: string, log?: any, target?: AICardTarget, ): Promise<string> { const logPrefix = 'RawMedia'; const rawPathPattern = /(?:^|\s)((?:[A-Za-z]:)?[\/\\](?:[^\/\\:\*\?"<>\|\s]+[\/\\])*[^\/\\:\*\?"<>\|\s]+\.(?:mp4|avi|mov|wmv|flv|mkv|webm|mp3|wav|flac|aac|ogg|m4a|wma|pdf|doc|docx|xls|xlsx|ppt|pptx|txt|zip|rar|7z|tar|gz))(?:\s|$)/gi; const matches = Array.from(content.matchAll(rawPathPattern)); if (matches.length === 0) { return content; } for (const match of matches) { const fullMatch = match[0]; const filePath = match[1].trim(); const uploadResult = await uploadMediaToDingTalk( filePath, mediaType, oapiToken, 20 * 1024 * 1024, log ); ``` The upload implementation accepts the supplied path without restricting it to an approved workspace: ```ts const absPath = toLocalPath(filePath); log?.info?.(`检查文件是否存在:${absPath}`); if (!fs.existsSync(absPath)) { log?.warn?.(`文件不存在:${absPath}`); return null; } const stats = fs.statSync(absPath); const form = new FormData(); form.append('media', fs.createReadStream(absPath), { filename: path.basename(absPath), contentType: mediaType === 'image' ? 'image/jpeg' : 'application/octet-stream', }); const resp = await dingtalkUploadHttp.post( `${DINGTALK_OAPI}/media/upload`, form, { params: { access_token: oapiToken, type: mediaType }, headers: form.getHeaders(), timeout: 60_000, maxBodyLength: Infinity, }, ); ``` ### Technical Analysis The connector scans agent-generated response text for absolute local paths with ...[truncated 2246 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove automatic processing of arbitrary absolute paths from model output. 2. Require media to be represented by opaque attachment identifiers rather than filesystem paths. 3. If path-based exports must remain supported: - Resolve the candidate and allowed root using `fs.realpathSync()`. - Require the canonical candidate path to remain inside a dedicated per-session export directory. - Reject symbolic links and non-regular files. - Reject files not created for the current request. 4. Do not allow access to home, root, configuration, credential, temporary files belonging to other sessions, or arbitrary operating-system directories. 5. Require explicit confirmation from an authenticated, authorized user before uploading a local file. 6. Bind generated artifacts to the requesting session using server-side metadata. 7. Add security tests for traversal, symbolic-link escape, `/root`, `/home`, Windows drive paths, cross-session files, and prompt-induced path disclosure. 8. Avoid logging full sensitive paths unless debug logging has been explicitly enabled. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/core/message-handler.ts:975
Finding
Default-Open Access Combined With Unconditional Command Authorization<![CDATA[ ## Vulnerability Details **File Location**: `src/config/schema.ts:110-111`; `src/core/message-handler.ts:975-983`, `1033-1055`, and `1411` **Vulnerability Type**: Missing authorization and insecure default access policy **Risk Level**: High ### Vulnerable Code The channel defaults direct messages and group messages to open access: ```ts dmPolicy: DmPolicySchema.optional().default("open"), groupPolicy: GroupPolicySchema.optional().default("open"), ``` The nominal pairing policy is not enforced: ```ts const dmPolicy = config.dmPolicy || 'open'; const allowFrom: (string | number)[] = config.allowFrom || []; // 处理 pairing 策略(暂不支持,当作 open 处理并记录警告) if (dmPolicy === 'pairing') { log?.warn?.(`dmPolicy="pairing" 暂不支持,将按 "open" 策略处理`); // 继续执行,不拦截 } ``` Group access also falls back to open: ```ts const groupPolicy = config.groupPolicy || 'open'; const conversationId = data.conversationId; const groupAllowFrom: (string | number)[] = config.groupAllowFrom || []; ``` Every accepted inbound context is then marked command-authorized: ```ts CommandAuthorized: true, ``` ### Technical Analysis The connector has allowlist checks, but they are only applied when administrators explicitly configure an allowlist policy. In the absence of such configuration, both direct and group traffic is accepted. More significantly, selecting `pairing` does not provide the expected authentication boundary. The implementation logs a warning and processes the sender as though the policy were `open`. This is a fail-open behavior. After these checks, `CommandAuthorized` is set to `true` without deriving the value from a successful allowlist, pairing, administrator, or role-based authorization decision. As a result, reachability of the DingTalk bot is treated as sufficient authorization for command-capable agent interaction. ### Attack Path 1. An administrator installs the connector without overriding its default policies, or configures `dmPolicy: "pairing"` expecting pairi ...[truncated 1361 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change direct-message and group defaults to deny, pairing, or explicit allowlist rather than `open`. 2. Implement the pairing policy fully. Until implemented, reject messages under `pairing` instead of degrading to open. 3. Compute `CommandAuthorized` from a verified authorization result: - `true` only for successfully paired or allowlisted identities. - `false` for ordinary conversational users unless command access was separately granted. 4. Distinguish permission to converse from permission to execute commands or invoke privileged tools. 5. Apply sender-level authorization inside groups instead of relying only on the group conversation identifier. 6. Require explicit administrator opt-in before enabling open access. 7. Display a prominent warning when an administrator intentionally enables an open policy. 8. Add tests proving that unknown users, empty sender IDs, unpaired users, and unauthorized group members cannot obtain command authorization. ]]>

T03 · Remote Payload Retrieval and Execution

Warning
Location
install-beta.sh:217
Finding
Mutable Remote Beta Branch Is Retrieved and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `install-beta.sh:15`, `217-240`, and the subsequent local plugin installation flow **Vulnerability Type**: Unpinned remote payload retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```bash BRANCH="${1:-feat/migrate-to-openclaw-sdk}" ``` ```bash cd /tmp rm -rf dingtalk-openclaw-connector-beta if ! git clone --single-branch --branch "$BRANCH" \ https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git \ dingtalk-openclaw-connector-beta; then echo "❌ 错误:克隆分支 '$BRANCH' 失败" echo "💡 提示:请检查分支名是否正确" exit 1 fi cd dingtalk-openclaw-connector-beta npm install ``` The downloaded directory is subsequently loaded as a plugin: ```bash openclaw plugins install -l . ``` ### Technical Analysis The installer clones a mutable branch from a remote repository. The caller may select any branch name, while the default is also a branch rather than an immutable commit or signed release. After cloning, the script runs `npm install`, which may execute dependency lifecycle scripts, and then installs the downloaded project as a locally linked OpenClaw plugin. No commit allowlist, checksum, release signature, provenance verification, or reproducible lockfile enforcement is shown. The effective code executed by this installer can therefore change after the reviewed package is published. The reviewed installer acts as a bootstrap channel for code not contained in the audited artifact. ### Attack Path 1. A user or administrator invokes `install-beta.sh`. 2. The script resolves the configured branch at its current remote head. 3. The remote branch, repository, maintainer account, or dependency graph is compromised or changed after this audit. 4. The script clones the modified content without validating an approved commit or signature. 5. `npm install` executes installation behavior from the downloaded package and dependency set. 6. `openclaw plugins install -l .` loads the downloade ...[truncated 783 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace branch-based installation with an immutable, audited commit hash or signed release tag. 2. Verify the downloaded commit against a hard-coded allowlist. 3. Validate a cryptographic checksum or signature before running package-manager or plugin commands. 4. Commit and enforce a lockfile, and use `npm ci` for reproducible dependency installation. 5. Use `npm ci --ignore-scripts` where dependency lifecycle scripts are not required. 6. Remove arbitrary branch selection from production installation workflows. 7. Display the exact commit hash and require explicit confirmation before beta installation. 8. Run installation in a restricted environment without unnecessary access to user secrets. 9. Publish beta artifacts through a provenance-enabled package or release process rather than executing the current head of a remote branch. ]]>

T01 · Skill Instruction Hijacking

Warning
Location
src/core/message-handler.ts:624
Finding
Inbound Card Links Inject Mandatory Tool-Use Instructions Into Agent Content<![CDATA[ ## Vulnerability Details **File Location**: `src/core/message-handler.ts:624-653` and `1437-1444` **Vulnerability Type**: Agent instruction injection and forced external-content retrieval **Risk Level**: Medium ### Vulnerable Code ```ts if (host === 'alidocs.dingtalk.com') { return [ `The inbound DingTalk message is an ${cardKind} with a document link.`, `Linked URL: ${linkUrl}`, `This URL is hosted on \`alidocs.dingtalk.com\`.`, `You MUST inspect and summarize it via the \`dws\` skill using its \`doc\` product capability.`, `If \`dws\` is not already visible in the skill snapshot, call \`search_skills\` to locate it, then call \`use_skill\` with the exact id.`, `Never switch to browser-based reading for this link. Browser incompatibility or markdown export limitations are not final answers.`, `Do not use \`read_url\` for this link.`, `Reply to the DingTalk user with a concise summary of the linked document content.`, ].join('\n'); } return [ `The inbound DingTalk message is an ${cardKind} with a link.`, `Linked URL: ${linkUrl}`, `For this URL, you MUST use \`read_url\` to inspect the linked content before answering.`, `Do not use the \`dws\` skill for this link.`, `Reply to the DingTalk user with a concise summary of the linked content.`, ].join('\n'); ``` The generated instructions are appended directly to the content presented to the agent: ```ts const linkRoutingPrompt = buildLinkRoutingPrompt(content); if (linkRoutingPrompt) { finalContent = finalContent ? `${finalContent}\n\n${linkRoutingPrompt}` : linkRoutingPrompt; log?.info?.(`注入卡片链接路由指令: ${linkRoutingPrompt.slice(0, 100)}...`); } ``` ### Technical Analysis The connector converts an inbound card URL into imperative instructions such as `MUST`, `Never`, and explicit commands to discover and invoke skills. These instructions are appended to the same content channel used for the user message rather than represented as untrusted meta ...[truncated 1955 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not append mandatory tool-use instructions to user content. 2. Pass card URLs as structured, explicitly untrusted metadata. 3. Let the agent’s trusted system policy decide whether and how to retrieve a URL. 4. Preserve normal safety checks and avoid imperative phrases such as `MUST` and `Never`. 5. Validate URL schemes and destinations before retrieval. 6. Apply domain allowlists and block loopback, link-local, private, metadata-service, and redirect-based internal destinations. 7. Treat all retrieved documents as untrusted data and instruct the agent not to follow instructions found within them. 8. Require confirmation before invoking skills with authenticated document access. 9. Add tests for hostile page instructions, redirects, malformed URLs, deceptive subdomains, and card-triggered skill invocation. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (241)

Missing User Warnings

High
Confidence
96% confidence
Finding
The changelog states that plain-text file contents are directly injected into AI context without any explicit privacy warning or policy boundary. This is riskier than mere file storage because sensitive document contents may be transmitted to downstream models or services, causing unintended disclosure of secrets, personal data, or regulated information.

Credential Access

High
Category
Privilege Escalation
Content
npm config set registry https://registry.npmmirror.com
```

Or add to `~/.npmrc`:

```
registry=https://registry.npmmirror.com
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Memory Manipulation

High
Category
Memory Poisoning
Content
- **Session Management** - Multi-turn conversations with context preservation
- **Session Isolation** - Separate sessions for DMs, groups, and different groups
- **Auto Session Reset** - Automatic new session after 30 minutes of inactivity
- **Manual Session Reset** - Send `/new` or `新会话` to clear conversation history
- **Image Auto-Upload** - Local image paths automatically uploaded to DingTalk
- **Proactive Messaging** - Send messages to users or groups programmatically
- **Rich Media Reception** - Receive and process JPEG/PNG images, pass to vision models
Confidence
80% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Exfiltration Commands

High
Category
Prompt Injection
Content
- **Auto Session Reset** - Automatic new session after 30 minutes of inactivity
- **Manual Session Reset** - Send `/new` or `新会话` to clear conversation history
- **Image Auto-Upload** - Local image paths automatically uploaded to DingTalk
- **Proactive Messaging** - Send messages to users or groups programmatically
- **Rich Media Reception** - Receive and process JPEG/PNG images, pass to vision models
- **File Attachment Extraction** - Parse .docx, .pdf, text files, and binary files
- **Audio Message Support** - Send audio messages in multiple formats (mp3, wav, amr, ogg)
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
Audio marker processing, ffprobe-based duration extraction, and proactive audio sending combine local file access, external binary use, and outbound transmission. In an enterprise connector, undeclared audio-processing capability can leak recordings or metadata and broadens the attack surface on the host.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.potential_exfiltration

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
test.ts:262

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
test.ts:254

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
tests/audio/audio.test.ts:46

File read combined with network send (possible exfiltration).

Warn
Code
suspicious.potential_exfiltration
Location
test.ts:167

File read combined with network send (possible exfiltration).

Warn
Code
suspicious.potential_exfiltration
Location
tests/chunk-upload/chunk-upload.test.ts:35