T09 · Insecure Skill Coding Practices
- Location
SKILL.md:158- Finding
Hardcoded WeCom Application Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is for WeCom messaging rules, but it exposes credential material and directs automatic cross-user storage of personal profile data.
Do not install this version without review. The publisher should remove and rotate the exposed WeCom credentials and webhook material, replace examples with placeholders or a secure integration layer, require explicit confirmation before sending messages or files, and stop storing user profile data in shared memory.
SKILL.md:158Hardcoded WeCom Application Credentials
SKILL.md:232Exposed WeCom Robot Webhook Credential Material
SKILL.md:257Automatic Collection and Cross-User Storage of Personal Data
The skill instructs automatic collection and shared-memory storage of user profile data without any user-facing warning or consent flow. This is dangerous because users are not informed that identity attributes are being fetched from an external API and persisted in a cross-session shared location.
The skill is presented as a messaging/rules standard, but it embeds live WeCom credentials, agent identifiers, and webhook capability that enable real outbound actions. This materially expands the skill from guidance into an operational secret-bearing integration, creating immediate risk of unauthorized messaging, abuse of enterprise channels, and credential leakage.
The skill includes credential acquisition flow for obtaining an access token, and elsewhere provides the corresponding secret and tenant details needed to authenticate. Exposed enterprise API credentials can allow attackers or unintended agents to impersonate the application, send messages, and query user data.
# 获取Access Token
curl -s "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CORP_ID&corpsecret=$SECRET"
# 发送应用消息(私聊)
Automatic periodic and per-conversation retrieval of user information is specified without privacy warning, making the collection invisible to the affected users. Hidden recurring collection significantly raises compliance and trust risks, especially when paired with persistence across sessions.
The skill directs ongoing harvesting of user profile data and persistence in a shared memory accessible across users, combining overcollection with insecure storage design. This makes the context more dangerous because the capability is automatic, repeated, and normalized as part of routine conversation handling.
This section explicitly pairs a live-looking corporate ID with a hardcoded secret and token retrieval command, which is direct credential exposure. In context, the skill also includes message-send and user-lookup calls, so the leaked secret can be used for both outbound messaging and user data access.
# 获取 Access Token
CORP_ID="wwd00a4d7e69fffdf1"
SECRET="Jg7-sBKn1rhynH_NUgAf-C6dxmNrpUIxLz8qfQ109OQ"
TOKEN=$(curl -s "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CORP_ID&corpsecret=$SECRET" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
The session-start workflow stores identity metadata in shared memory for all users without warning that it is cross-user accessible. This creates a clear risk of privacy violation and unauthorized disclosure because identifying data is normalized into a public/shared context.
The skill explicitly states that public/shared memory is shared by all users and still instructs storing identity details there. This is a direct privacy and segregation failure that could expose user names, IDs, and gender across unrelated users or workflows.
The skill mandates outbound WeCom transmission for files and messages by default, but does not clearly warn users that content will be sent externally or that fallback methods may be used on failure. This can lead to unexpected external transmission of sensitive material and reduced user control over delivery paths.
The trigger phrases for proactive outbound messaging are broad enough to match ordinary conversational text, which can cause unintended sends to enterprise contacts. In a system with real messaging capability, ambiguous triggers increase the chance of accidental data disclosure or unauthorized communication.
The skill mandates automatic retrieval of user profile data and storage into shared memory even though its stated purpose is messaging rules. This is unnecessary data collection and persistence, and shared storage increases the chance of cross-user exposure and misuse of personal information.
The instructions require collecting and storing identity data in shared memory across conversations, which violates data minimization and separation principles. Shared persistence of personal data can expose one user's information to unrelated contexts, tools, or users.
The skill forces gender-based honorifics and defaults to a gendered form of address without user choice. While not a classic technical exploit, it drives unnecessary collection/inference of sensitive personal attributes and can produce harmful or inappropriate communications.
This snippet performs real external transmission to the WeCom message API using an access token, enabling outbound delivery of content to enterprise recipients. In the context of a skill file, embedding executable transmission patterns increases the chance of unauthorized or accidental exfiltration and misuse.
TOKEN=$(curl -s "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CORP_ID&corpsecret=$SECRET" | jq -r '.access_token')
curl -s -X POST "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$TOKEN" \
-H "Content-Type: application/json" \
-d '{
"touser": "用户ID",
The documented commands fetch tokens and send messages to external WeCom endpoints, so the skill contains actionable external communication behavior rather than passive policy text. This is risky because it can be repurposed for unauthorized outbound messaging or data transfer if the embedded configuration is valid.
# 获取Access Token
curl -s "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CORP_ID&corpsecret=$SECRET"
# 发送应用消息(私聊)
curl -s -X POST "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$TOKEN" \
The skill broadens into periodic and conversation-triggered harvesting of user information from the WeCom API, which is outside the narrow scope of formatting or delivery rules. Continuous collection tied to routine interactions creates a surveillance-like behavior and increases privacy and data handling risk.
The repeated policy reinforces use of gendered honorifics based on retrieved profile information without offering a neutral option or user preference. This increases privacy and dignity risks by operationalizing personal attribute inference in routine messaging.