Back to skill

Security audit

DingTalk Bot

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward DingTalk integration that uses provided DingTalk credentials for messaging, group, approval, and attendance operations, with no hidden persistence or unrelated data access found.

Install only if you intend to let the agent use DingTalk with organization-approved app credentials. Limit DingTalk app scopes to the exact messaging, group, approval, and attendance actions needed, and treat attendance, vacation, approval, user, and group membership data as sensitive. Review the send_to_user implementation before relying on it because it posts to a relative endpoint instead of the configured DingTalk API base.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Credential Access

High
Category
Privilege Escalation
Content
# ==================== Authentication ====================
    
    def _get_access_token(self) -> str:
        """Get or refresh access token"""
        if self._access_token and time.time() < self._token_expires_at:
            return self._access_token
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Exfiltration Commands

High
Category
Prompt Injection
Content
return result
    
    def send_to_user(self, user_id: str, msg_type: str, content: Dict) -> Dict:
        """Send message to user"""
        endpoint = "/robot/send"
        params = {"access_token": self._get_access_token()}
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill documents capabilities that inherently use network access and environment-provided secrets, but it does not declare any tool scope or permission boundaries. In an agent environment, this can lead to overbroad execution rights, making secret access and outbound requests less visible and harder to constrain or audit.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill enables attendance lookups and approval workflow operations involving employee records and internal business process data, but it does not warn users that these actions may expose sensitive HR and operational information. In agent-driven use, lack of sensitivity labeling and usage constraints increases the risk of inappropriate access, over-collection, or disclosure of personal and workflow data.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The module performs multiple HTTP requests to DingTalk APIs and webhooks, transmitting credentials, message contents, user identifiers, attendance data, approval data, and group-management actions. Aside from terse function docstrings, there is no explicit warning, confirmation, or user-facing disclosure that this information is sent to external services.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        }
        
        resp = requests.post(url, json=data)
        return resp.json()
    
    def send_markdown(self, title: str, text: str) -> Dict:
Confidence
80% 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
}
        }
        
        resp = requests.post(url, json=data)
        return resp.json()
    
    def send_markdown(self, title: str, text: str) -> Dict:
Confidence
80% 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
}
        }
        
        resp = requests.post(url, json=data)
        return resp.json()
    
    def send_markdown(self, title: str, text: str) -> Dict:
Confidence
80% 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
}
        }
        
        resp = requests.post(url, json=data)
        return resp.json()
    
    def send_markdown(self, title: str, text: str) -> Dict:
Confidence
80% 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
}
        }
        
        resp = requests.post(url, json=data)
        return resp.json()
    
    def send_markdown(self, title: str, text: str) -> Dict:
Confidence
80% 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
msg_type: content
        }
        
        resp = requests.post(endpoint, params=params, json=data)
        return resp.json()
    
    # ==================== Group Management ====================
Confidence
97% confidence
Finding
This method posts to a relative endpoint string instead of the DingTalk API base URL, which can cause the request to fail or be redirected through unintended client configuration paths. In environments with a custom requests adapter, session wrapper, or monkeypatching, this could send user message content and access tokens to an unintended destination, creating leakage risk.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This code reads DingTalk webhook and app credentials from environment variables, including secrets, without any user-facing warning, logging, or comment disclosing that sensitive credentials are accessed. For code files, accessing sensitive environment variables should have some visible disclosure unless clearly covered elsewhere in skill documentation, which is not present in this file.

Static analysis

No suspicious patterns detected.