Back to skill

Security audit

微信公众号贴图发布器

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: uploads user-provided images and text to WeChat to create draft-only posts, with no hidden publishing or persistence behavior found.

Install only if you intend to let the skill upload selected local images and draft text to your WeChat Official Account. Keep WECHAT_APP_SECRET private, avoid committing wechat.env or output records, and review generated drafts manually in WeChat before publishing.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tainted flow: 'app_id' from os.environ.get (line 46, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/publish_sticker.py (reported line 54)May include surrounding context.

python
def get_access_token(app_id: str, app_secret: str) -> str:
    r = requests.get(
        f'{API_BASE}/token',
        params={
            'grant_type': 'client_credential',

Tainted flow: 'access_token' from os.environ.get (line 141, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/publish_sticker.py (reported line 73)May include surrounding context.

python
def add_material_image(access_token: str, image_path: Path):
    mime = mimetypes.guess_type(str(image_path))[0] or 'image/jpeg'
    with image_path.open('rb') as f:
        r = requests.post(
            f'{API_BASE}/material/add_material',
            params={'access_token': access_token, 'type': 'image'},
            files={'media': (image_path.name, f, mime)},

Tainted flow: 'access_token' from os.environ.get (line 141, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/publish_sticker.py (reported line 102)May include surrounding context.

python
]
    }
    body = json.dumps(payload, ensure_ascii=False).encode('utf-8')
    r = requests.post(
        f'{API_BASE}/draft/add',
        params={'access_token': access_token},
        data=body,

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/api-notes.md (reported line 13)May include surrounding context.

md
## API flow used by this skill

1. Get access token
   - `GET /cgi-bin/token`
2. Upload each local image as a permanent image material
   - `POST /cgi-bin/material/add_material?type=image`

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/api-notes.md (reported line 47)May include surrounding context.

md
## Security / publishing hygiene

Do not publish:
- access tokens
- app ids / secrets
- output logs containing real media IDs or remote asset URLs if they are not intended for distribution
- local absolute paths from the author's private workspace

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares no explicit tool scope or permission boundary even though its documented behavior requires reading local files, writing output records, accessing environment variables or a local credential file, and making network requests to the WeChat API. Without an allowlist, an agent runtime may grant broader-than-necessary access or leave operators unable to verify what the skill is permitted to do, increasing the risk of unintended file access, credential exposure, or misuse of network capabilities.

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/publish_sticker.py (reported line 19)May include surrounding context.

python
DEFAULT_ENV_CANDIDATES = [
    ROOT / 'wechat.env',
]
API_BASE = 'https://api.weixin.qq.com/cgi-bin'


def load_env_file(path: Path):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code reads sensitive credentials from environment variables and then sends them to a remote WeChat API to obtain an access token. While the behavior is functionally necessary, there is no confirmation prompt, user-facing print/log message, or explanatory comment/docstring disclosing that credentials will be used in a network request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script uploads local image files and submits title/text content to external WeChat endpoints, which can transmit user data off-system. There is no confirmation prompt, warning print/log, or explanatory comment/docstring informing the user that local files and provided content are being sent to a remote service.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified as requests>=2.31.0, which allows installation of any future version and makes builds non-reproducible. This can unintentionally introduce vulnerable or breaking releases over time, especially in a skill that interacts with external APIs and may handle access tokens or account content.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

Because requests is not pinned, it is impossible to verify whether the installed version is affected by any of its known advisories. In this skill's context, which likely makes authenticated HTTP requests to the WeChat official API, an affected requests version could expose credentials or weaken transport/security behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script writes a detailed JSON artifact containing post text, title, author, uploaded filenames, upload responses, and draft API results to disk under outputs/. This creates a local data exposure risk because sensitive or unpublished content may remain on disk longer than intended and could be readable by other local users, backups, or downstream tooling.

Content

No source excerpt is available for this finding.