T09 · Insecure Skill Coding Practices
- Location
scripts/auto_publish.py:506- Finding
WordPress credentials transmitted over connections with disabled TLS verification
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent news auto-publisher, but it needs Review because it can publish live CMS content while using unsafe TLS handling and broad URL fetching.
Before installing, require HTTPS with normal certificate validation, avoid HTTP CMS URLs, use a dedicated low-privilege WordPress application password, default first runs to preview or draft, and restrict news/image/custom API URLs to trusted public destinations.
scripts/auto_publish.py:506WordPress credentials transmitted over connections with disabled TLS verification
scripts/fetch_news.py:72Unrestricted URL fetching enables server-side request forgery
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
req = Request(url, headers=headers)
try:
with urlopen(req, timeout=timeout) as resp:
return resp.read()
except Exception:
# Retry with SSL context
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
try:
import certifi
ctx = ssl.create_default_context(cafile=certifi.where())
with urlopen(req, timeout=timeout, context=ctx) as resp:
return resp.read()
except ImportError:
raise
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
req = Request(url, headers=headers)
try:
with urlopen(req, timeout=15) as resp:
data = json.loads(resp.read())
results = data.get("results", [])
if results:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
req = Request(url, headers=headers)
try:
with urlopen(req, timeout=15) as resp:
data = json.loads(resp.read())
results = data.get("results", [])
if results:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"Authorization": self.auth_header,
}
)
with urlopen(req, timeout=8) as resp:
if resp.status == 200:
self.use_rest_route = False
logger.info("API: /wp-json/ style")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
for attempt in range(retries + 1):
try:
req = Request(url, data=body, headers=headers, method=method)
with urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode("utf-8"))
except (URLError, ConnectionError, OSError) as e:
if attempt < retries:
The declared description describes an end-to-end pipeline: fetching global news from RSS/API sources, automatically generating articles with images, and publishing them. The supplied code chunk implements only the publishing stage. It reads article data from a local JSON file, optionally does a dry run, uploads an existing image file, resolves/creates WordPress categories and tags, and publishes to WordPress or a configurable custom CMS endpoint. There is no logic for fetching news from RSS/API sources, scraping, summarization, article writing, or image generation. Therefore the description materially overstates what this code chunk actually does, making it a mismatch.
The image upload path explicitly disables TLS hostname verification and certificate validation before sending WordPress Basic Auth credentials and media content. This enables man-in-the-middle interception or credential theft on any hostile network path and is especially dangerous because the skill performs authenticated publishing to a CMS.
The code silently disables TLS verification for WordPress media uploads without any user warning or compensating control. Because Basic Auth credentials are used, an attacker intercepting traffic could capture credentials, alter uploaded content, or hijack the publishing workflow.
The README prominently markets automatic fetching, image generation, and publishing to a live WordPress or CMS target, but it does not clearly warn that invoking the skill may immediately create public posts and upload media to the user's site. In an automation context, that omission can cause unintended public content publication, reputational damage, and hard-to-reverse site changes, especially because users may assume a dry-run or draft-first workflow.
Documenting publishing.status with a default of publish normalizes immediate live publication without emphasizing that this makes generated content publicly visible right away. Because this skill automates both content generation and CMS posting, a risky default materially increases the chance of accidental publication of low-quality, incorrect, or policy-violating content.
The skill declares no explicit tool scope even though its documented behavior requires environment access, file reads/writes, and outbound network actions. In an agent setting, missing scope declarations reduce transparency and guardrails, making it easier for the skill to perform sensitive actions like publishing content or reading secrets without clear user review.
The default command performs live network publishing to a user CMS, but the skill does not present a strong up-front warning or require confirmation before making external changes. This raises the risk of accidental content publication, unintended media uploads, and remote state changes triggered by a casual invocation of the main command.
The sample config sets "language": "zh", which imposes a specific locale in the skill's natural-language behavior. The file does not explain that this is region-specific or present it as an explicit user choice in the example, creating a language policy concern.
This is a markdown file, so SQP-2 applies to omissions in user-facing safety warnings. The section shows a plaintext API_KEY in ~/.openclaw/openclaw.json but does not warn readers that credentials are sensitive, should be protected, and may be exposed via file sharing, backups, or source control.
The markdown describes automatic log analysis, alert webhooks, RSS/content extraction, image search, and WordPress auto-publishing, all of which can transmit operational or content data to external services. There is no accompanying warning about reviewing destinations, verifying consent/ownership of content, or the risk of exposing system or user data.
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.
mkdir -p ~/.openclaw/workspace/skills/my-skill
SKILL.md:Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"_comment": "Uncomment and configure for custom API",
"type": "custom",
"name": "My Custom Source",
"url": "https://api.example.com/news",
"headers": {
"Authorization": "$MY_API_TOKEN"
},
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"_comment": "Uncomment and configure for custom API",
"type": "custom",
"name": "My Custom Source",
"url": "https://api.example.com/news",
"headers": {
"Authorization": "$MY_API_TOKEN"
},
The manifest sets "language": "zh" as a fixed default, which is a natural-language locale constraint. There is no indication in this file that users can opt into another language or that the skill is specifically intended only for a Chinese-language or China-region use case.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def search_unsplash(query: str, api_key: str) -> str:
"""Search Unsplash for an image, return download URL."""
url = f"https://api.unsplash.com/search/photos?query={quote(query)}&per_page=1&orientation=landscape"
headers = {
"Authorization": f"Client-ID {api_key}",
"Accept": "application/json",
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
if len(img_data) < 1000:
logger.warning(f"Downloaded image too small ({len(img_data)} bytes), skipping")
return ""
with open(local_path, "wb") as f:
f.write(img_data)
logger.info(f"Image downloaded: {local_path} ({len(img_data)} bytes)")
return str(local_path)
The pipeline assigns a default language of "en" when no language is configured, which imposes a specific locale without any visible user choice in this file. This can violate language/locale policy because the behavior prefers English by default rather than prompting for or documenting user opt-in.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
class PexelsFetcher:
"""Fetch images from Pexels API."""
BASE_URL = "https://api.pexels.com/v1"
def __init__(self, api_key: str):
self.api_key = api_key
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
class PexelsFetcher:
"""Fetch images from Pexels API."""
BASE_URL = "https://api.pexels.com/v1"
def __init__(self, api_key: str):
self.api_key = api_key