Back to skill

Security audit

dingtalk-daily

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with DingTalk report management, but it needs review because it uses enterprise credentials for sensitive workplace data, employee lookup, report submission, and can print a live access token.

Review this before installing in an enterprise tenant. Use a least-privilege DingTalk internal app, avoid running scripts/auth.js directly, confirm report recipients and chat notifications before sending, and only allow authorized users to query reports or search employee IDs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.js:57
Finding
DingTalk Access Token Exposed Through Standard Output## Vulnerability Details **File Location**: `scripts/auth.js`, lines 57-61 **Vulnerability Type**: Plaintext sensitive token disclosure **Risk Level**: Medium **Vulnerable Code:** ```javascript if (require.main === module) { getAccessToken() .then(token => { console.log(JSON.stringify({ success: true, access_token: token })); ``` ### Technical Analysis When `auth.js` is executed directly, the script obtains a live DingTalk bearer token and writes the complete token to standard output. This disclosure is unnecessary for the normal operation of the other scripts, which import `getAccessToken()` and use the returned token internally. Standard output may be retained in AI Agent transcripts, CI/CD logs, process-management logs, terminal recordings, or diagnostic output. Because the token authenticates API requests, anyone who can read such retained output may be able to reuse it until it expires. No additional vulnerability is required once the token has been captured. ### Attack Path 1. An operator, Agent workflow, troubleshooting process, or automated task directly executes `node scripts/auth.js`. 2. The script reads the configured AppKey and AppSecret and requests a valid access token from DingTalk. 3. The complete access token is printed to standard output. 4. An attacker or unauthorized user with access to the transcript or log extracts the token. 5. The attacker submits the token to DingTalk API endpoints before it expires. 6. DingTalk authorizes operations according to the permissions granted to the associated internal application. ### Impact Assessment Successful exploitation permits temporary use of the DingTalk application's delegated API privileges. Depending on the application's configured scopes, the exposed token may enable access to employee information and reports, or permit report creation and related operations. The precise scope is constrained by the permissions assigned to the Ding ...[truncated 139 chars]
Remediation
## Remediation Suggestions - Remove the direct-execution behavior that prints the token, or replace it with a message that only confirms successful authentication. - Keep access tokens exclusively in process memory and pass them directly to the API client. - If diagnostic output is necessary, redact the entire token rather than printing a partial reusable value. - Configure orchestration and CI systems to prevent secret-bearing output from being retained. - Review existing logs and Agent transcripts for previously exposed tokens, restrict access to those records, and rotate the associated application secret if exposure is suspected. - Grant the DingTalk application only the API scopes required for report management and user search.

T08 · Insecure Dependencies

Note
Location
SKILL.md:8
Finding
Unpinned Axios Installation Creates Non-Reproducible Supply-Chain Exposure## Vulnerability Details **File Location**: `SKILL.md`, lines 8-9 and 24-28 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Low **Vulnerable Configuration and Instructions:** ```yaml system: - npm install axios ``` ```markdown - Dependency notes: the scripts use axios for HTTP requests ```bash npm install axios ``` ``` ### Technical Analysis The Skill directs users or its runtime environment to install `axios` without specifying a reviewed version. The project also lacks a package manifest and committed lockfile in the audited directory. Consequently, the installed Axios release and its transitive dependency graph are resolved at installation time and can differ from the code evaluated during this audit. npm dependency installation may also execute package lifecycle scripts. If the package or one of its transitive dependencies is compromised in the future, installation could introduce and execute code that was not present during review. The dependency name is the legitimate `axios` package name, and the audited material contains no evidence of typosquatting, dependency confusion, or a currently malicious package; the finding concerns unsafe, non-reproducible dependency resolution. ### Attack Path 1. A user or deployment workflow follows the Skill instructions and runs `npm install axios`. 2. npm resolves the latest package version and its current transitive dependencies rather than a previously audited dependency set. 3. If a resolved release or transitive package has been compromised, malicious package code or lifecycle scripts are downloaded. 4. Installation-time scripts may execute with the privileges of the user or service performing the installation. 5. Compromised runtime code may subsequently access the Skill process environment, including the configured DingTalk credential, or alter outbound API operations. ### Impact Assessment The potential impact is ...[truncated 477 chars]
Remediation
## Remediation Suggestions - Add a minimal `package.json` that declares an explicitly reviewed Axios version. - Generate and commit a `package-lock.json` so production and audit installations resolve the same dependency graph. - Use `npm ci` rather than an unconstrained `npm install` in automated environments. - Use `npm ci --ignore-scripts` when dependency lifecycle scripts are not required. - Review dependency updates explicitly and run vulnerability and integrity checks before changing the lockfile. - Ensure the package registry is explicitly configured to a trusted source and protect installation environments from unauthorized registry configuration changes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
This mismatch is more security-relevant because the skill’s declared purpose is focused on report management, but it also introduces directory-search behavior against the contact/users/search API. Accessing employee directory data expands the data domain into personal identifiers and can enable unnecessary collection or enumeration of user information beyond the originally declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
This mismatch is more security-relevant because the skill’s declared purpose is focused on report management, but it also introduces directory-search behavior against the contact/users/search API. Accessing employee directory data expands the data domain into personal identifiers and can enable unnecessary collection or enumeration of user information beyond the originally declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
This mismatch is more security-relevant because the skill’s declared purpose is focused on report management, but it also introduces directory-search behavior against the contact/users/search API. Accessing employee directory data expands the data domain into personal identifiers and can enable unnecessary collection or enumeration of user information beyond the originally declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
This mismatch is more security-relevant because the skill’s declared purpose is focused on report management, but it also introduces directory-search behavior against the contact/users/search API. Accessing employee directory data expands the data domain into personal identifiers and can enable unnecessary collection or enumeration of user information beyond the originally declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
This mismatch is more security-relevant because the skill’s declared purpose is focused on report management, but it also introduces directory-search behavior against the contact/users/search API. Accessing employee directory data expands the data domain into personal identifiers and can enable unnecessary collection or enumeration of user information beyond the originally declared purpose.

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/create-report.js --userid <用户工号> --template-id <模板ID> --contents '<JSON内容>' [--to-userids <接收人ID列表>] [--to-chat true]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/create-report.js --userid <用户工号> --template-id <模板ID> --contents '<JSON内容>' [--to-userids <接收人ID列表>] [--to-chat true]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/create-report.js --userid <用户工号> --template-id <模板ID> --contents '<JSON内容>' [--to-userids <接收人ID列表>] [--to-chat true]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/create-report.js --userid <用户工号> --template-id <模板ID> --contents '<JSON内容>' [--to-userids <接收人ID列表>] [--to-chat true]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/search-user.js --query-word <用户姓名> [--offset 0] [--size 10] [--full-match 1]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/search-user.js --query-word <用户姓名> [--offset 0] [--size 10] [--full-match 1]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- 调用:`node scripts/search-user.js --query-word <用户姓名> [--offset 0] [--size 10] [--full-match 1]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill declares required credentials and clearly relies on environment-provided secrets, but it does not define an explicit tool scope such as allowed-tools or permissions. That makes the operational boundary unclear and can let an agent invoke environment-backed capabilities without a documented least-privilege restriction, increasing the chance of unintended secret use or overbroad execution.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger conditions include broad natural-language expressions such as viewing reports or work summaries, which can cause accidental activation in unrelated conversations. In a skill that can read or send workplace logs and use enterprise credentials, overbroad triggering raises the risk of unintended access, submission, or disclosure of sensitive work content.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill describes querying employee logs and generating work-quality summaries and scores without any privacy, consent, or impact warning. Because daily and weekly reports may contain sensitive performance, project, and interpersonal information, automated summarization and scoring can amplify surveillance and create harmful employment inferences if used without transparency and authorization controls.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill adds a name-based employee lookup capability that exceeds the initially declared purpose of handling reports and scoring. Scope expansion without clear disclosure is dangerous because it normalizes collection of personnel directory data and may let users repurpose the skill for employee enumeration or identity discovery.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The spec instructs use of appkey and appsecret to obtain an access token but provides no warning about secure secret storage, redaction, or avoiding client-side exposure. This can lead implementers to embed long-lived credentials in prompts, logs, or front-end code, enabling token theft and unauthorized access to the DingTalk tenant.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The create-report API supports sending reports and notifications to other users or chats, but the spec omits warnings that this may disclose work contents to unintended recipients or trigger visible side effects. In an agent setting, unclear consent and recipient validation can cause accidental internal data leakage or unauthorized notifications.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The file's user-facing natural language is entirely in Chinese, including the header comments and later runtime error strings, with no indication that the skill is region-specific or that users can opt into this locale. Under the stated policy, forcing a specific language without user choice or justification is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This code file contains natural-language text that is exclusively Chinese in the header comments and throughout user-visible messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly justified, which is not indicated here.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This JavaScript file contains user-facing natural-language text exclusively in Chinese, including the top-level description and thrown error messages. Under the policy rule, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This code sends a user-provided name query to the DingTalk API and includes an access token in the request headers. While the function has internal comments, there is no user-facing warning, confirmation, or visible disclosure in this file that user data will be sent to an external service.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const response = await axios.post(
      'https://api.dingtalk.com/v1.0/contact/users/search',
      requestBody,
      {
        headers: {
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const response = await axios.post(
      'https://api.dingtalk.com/v1.0/contact/users/search',
      requestBody,
      {
        headers: {
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The employee search feature lacks a notice that it queries personnel information by name and returns identifiers. Even if the returned data is limited, undisclosed lookup of employee identity data can facilitate casual enumeration and privacy misuse, especially in an enterprise context.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/auth.js:22