T09 · Insecure Skill Coding Practices
- Location
wechat_search.py:137- Finding
Weak WeChat Hostname Validation Permits Deceptive External Links
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is aimed at public WeChat article search, but its implementation does not enforce important safety claims and may mark deceptive external links as valid WeChat results.
Install only if you are comfortable with external web searches for your queries and the weaker-than-advertised compliance controls. Treat returned URLs as untrusted, avoid sensitive search terms, and prefer a fixed version that validates hostnames exactly, URL-encodes queries, pins dependencies, and either implements or removes the claimed robots.txt/rate-limit/User-Agent guarantees.
wechat_search.py:137Weak WeChat Hostname Validation Permits Deceptive External Links
wechat_search.py:21Documented Request-Safety Controls Are Loaded but Not Enforced
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
## Configuration
Create `~/.openclaw/wechat-search-config.json` to customize behavior:
```json
{
The skill describes capabilities that imply network access, shell-style invocation, and local file interaction, but it does not declare any explicit tool scope or permissions boundary. This creates ambiguity about what the agent may use at runtime, increasing the risk of over-privileged execution or unintended access to local resources and external services.
The skill instructs users to create a persistent configuration file under ~/.openclaw, which introduces session persistence on the local system. Even though the example appears to store benign settings, persistent local state can retain sensitive values later, such as API keys or behavior overrides, and may be read or modified by other processes if not protected.
## Configuration
Create `~/.openclaw/wechat-search-config.json` to customize behavior:
```json
{
The skill forwards user-supplied queries to external services through OpenClaw web_search and web_fetch without any explicit in-file warning, consent, or data-handling notice. If users include sensitive internal terms, credentials, or personal data in queries, that information may be disclosed to third-party services and logs outside the local trust boundary.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
search_query = f'{query} site:mp.weixin.qq.com'
# Call OpenClaw's web_search tool
result = subprocess.run([
'openclaw', 'tool', 'web_search',
'--query', search_query,
'--count', str(max_results)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
search_url = f"https://weixin.sogou.com/weixin?type=2&query={query}"
# Call OpenClaw's web_fetch tool
result = subprocess.run([
'openclaw', 'tool', 'web_fetch',
'--url', search_url,
'--extract-mode', 'markdown'
This markdown file states that the skill falls back to direct page fetching and web search, which can transmit user queries to external services and websites. While the README explains the mechanism and compliance posture, it does not explicitly disclose this as a user-facing privacy/network behavior to watch for.
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or incompatible releases, especially for a network-facing library like requests.
# Core dependencies
requests>=2.25.0
beautifulsoup4>=4.9.0
# Test dependencies
The manifest does not pin requests, and requests has multiple known advisories across its version history, so there is no way to verify that an installed version is safe. In this skill's context, requests is a core runtime dependency used for web search/fetch operations, making dependency uncertainty more significant because vulnerable HTTP handling could affect live network interactions.
beautifulsoup4 is also unpinned, so builds are not reproducible and may pull in newer versions with unexpected behavior or security issues. While this package is less security-sensitive than an HTTP client, unpinned dependencies still increase supply-chain risk.
# Core dependencies
requests>=2.25.0
beautifulsoup4>=4.9.0
# Test dependencies
pytest>=6.0.0
pytest is a test dependency, but leaving it unpinned can still expose CI or development environments to supply-chain or tooling-related issues. The risk is lower than for runtime dependencies because it is not typically shipped in production execution paths.
beautifulsoup4>=4.9.0
# Test dependencies
pytest>=6.0.0
pytest-cov>=2.10.0
mock>=4.0.0
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
pytest-cov is unpinned, which can make CI and test environments non-reproducible and may introduce vulnerable or unstable versions. This is mainly a software supply-chain hygiene issue rather than an immediate application exploit path.
# Test dependencies
pytest>=6.0.0
pytest-cov>=2.10.0
mock>=4.0.0
mock is specified as a minimum version only, so dependency resolution may vary across installations. Although it is a test-only package, unpinned tooling still increases supply-chain uncertainty and can affect CI or developer workstations.
# Test dependencies
pytest>=6.0.0
pytest-cov>=2.10.0
mock>=4.0.0
No suspicious patterns detected.