T09 · Insecure Skill Coding Practices
- Location
oref_native.py:30- Finding
Unsafe hardcoded external messaging and Home Assistant destinations
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This emergency-alert skill is plausibly useful, but it asks for broad, persistent system access and credentials while contradicting its own OpenClaw-only claims.
Review carefully before installing. Use only in a test environment first, set all destinations explicitly, avoid entering broad Home Assistant tokens, inspect and remove any crontab entry after testing, and do not run the installer as root unless you have reviewed the Docker image and persistence behavior.
oref_native.py:30Unsafe hardcoded external messaging and Home Assistant destinations
install.sh:28Unconditional installation of reboot persistence
install.sh:45Arbitrary command execution through unsafe environment-file sourcing
install.sh:93Home Assistant token and other configuration secrets copied into crontab
install.sh:18Unpinned Python packages and mutable Docker image are executed during installation
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def cx3_call(text: str):
"""חייג לשלוחה 3CX עם הודעת התרעה"""
try:
r = requests.post(CX3_API,
json={"to": CX3_EXTENSION, "message": text, "language": "he"},
timeout=10)
if r.status_code == 200:
HA_URL is fully configurable and the code sends the Home Assistant bearer token in the Authorization header to whatever endpoint that variable specifies. If an attacker can influence the environment or deployment config, they can redirect this request to an attacker-controlled server and exfiltrate the long-lived token, enabling unauthorized control of the Home Assistant instance.
def ha_tts(text: str):
"""הכרז קולית דרך רמקול Home Assistant"""
try:
r = requests.post(
f"{HA_URL}/api/services/tts/google_translate_say",
headers={"Authorization": f"Bearer {HA_TOKEN}", "Content-Type": "application/json"},
json={"entity_id": HA_TTS_SPEAKER, "message": text, "language": "iw"},
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def check_alert():
global last_alert_id, alert_sent_at, all_clear_sent
try:
data = requests.get(OREF_API, timeout=5).json()
except Exception as e:
log.warning(f"⚠️ API: {e}")
return
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
bash install.sh
# Test API
curl -s http://localhost:49000/current | python3 -m json.tool
# Test 3CX call manually
curl -X POST http://localhost:3000/api/outbound-call \
This second mismatch finding reinforces that the skill claims to be OpenClaw-only while static analysis indicates Home Assistant-backed TTS, additional call-routing capability, and daemonized monitoring behavior. Misrepresentation of runtime behavior increases the chance of unsafe deployment, especially where external systems, credentials, and always-on execution are involved.
This second mismatch finding reinforces that the skill claims to be OpenClaw-only while static analysis indicates Home Assistant-backed TTS, additional call-routing capability, and daemonized monitoring behavior. Misrepresentation of runtime behavior increases the chance of unsafe deployment, especially where external systems, credentials, and always-on execution are involved.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="$SCRIPT_DIR/.env"
LOG_FILE="/var/log/oref_native.log"
echo "🚨 ORef Alerts - OpenClaw Native Installer"
The skill metadata says 'No Docker monitor,' yet the installer starts and manages a Docker container. This mismatch is a trust and transparency problem: users may approve the skill under false assumptions, while the installer introduces additional runtime code, network exposure, and supply-chain risk not disclosed in the manifest.
The manifest claims 'No Home Assistant,' but the installer prompts for a Home Assistant URL and token and stores them for later use. This undisclosed expansion of scope is dangerous because it solicits sensitive credentials and creates an integration path to another trusted system the user may not expect this skill to access.
The documentation states that OpenClaw TTS is used, but the implementation actually performs TTS through Home Assistant with a bearer token. Misleading documentation about which component handles voice announcements can cause unsafe deployment decisions, hidden secret provisioning, and underestimation of external trust dependencies.
The skill metadata and module comments claim there is no Home Assistant dependency, yet the code uses Home Assistant for TTS and transmits a bearer token to that service. This discrepancy is security-relevant because operators may deploy the skill under false assumptions about network exposure, secret usage, and required trust boundaries.
The top-level description presents the skill as fully OpenClaw-native with no Home Assistant involvement. Elsewhere in the same file, the architecture and configuration explicitly include optional Home Assistant TTS and a Docker-based ORef proxy, so the stated scope is materially broader than the description suggests.
This is an active contradiction within the documentation, not merely an omission. The introductory claim conflicts with the architecture and configuration sections that explicitly describe Home Assistant TTS and 3CX call integrations.
The README describes automatic WhatsApp group messaging and outbound phone calls for alerts without an explicit caution that test or live configuration may contact real recipients. In an alerting skill, this increases the risk of accidental disruptive notifications, nuisance calls, or panic if a user follows setup steps without understanding the external effects.
The manual test command triggers an outbound call through a local 3CX API endpoint, which can contact a real extension with spoken content. In this skill's context, that creates a real-world notification channel that can be abused or triggered accidentally, causing disruption, harassment, or unintended alerting even though the endpoint shown is localhost.
curl -s http://localhost:49000/current | python3 -m json.tool
curl -X POST http://localhost:3000/api/outbound-call
-H "Content-Type: application/json"
-d '{"to":"12610","message":"בדיקת מערכת התרעות","language":"he"}'
The skill advertises operational behavior that clearly requires powerful capabilities (environment access, network access, and shell/process execution) but does not declare any tool scope or permission boundaries. In an agent ecosystem, missing scope declarations weaken reviewability and least-privilege enforcement, making it easier for a skill to run with broader privileges than users expect.
The skill routes alerts to a WhatsApp group and speaks them aloud, but the description does not prominently warn users about these disclosure channels. That omission can cause unintended exposure of sensitive location or emergency-status information to group members or anyone within hearing range.
The setup instructions recommend background execution with nohup and persistence at boot via crontab @reboot, establishing a continuously running process outside normal interactive control. Persistence is security-relevant because it survives reboots, can evade casual visibility, and expands the blast radius if the monitored script is modified or compromised later.
# Install cron (every 5 seconds via loop)
nohup python3 /root/.openclaw/workspace/skills/oref-native/oref_native.py \
>> /var/log/oref_native.log 2>&1 &
# Or add to crontab (restart on boot)
The header explicitly says 'no Home Assistant needed' while the script later collects and stores Home Assistant credentials. Contradictory messaging reduces informed consent and can socially engineer users into entering secrets under the belief that the integration is unnecessary or dormant.
The installer pulls and runs dmatik/oref-alerts:latest without pinning a specific version or image digest, which makes the deployed code mutable over time and vulnerable to upstream supply-chain compromise. In an installer context, this is especially risky because the container is started automatically and exposed on a host port, so a malicious or compromised future image would execute immediately on the user's system.
The installer collects a Home Assistant token and writes it to a plaintext .env file in the skill directory without warning, permission hardening, or secure secret handling. If local users, backups, logs, or other processes can read that file, the token could be stolen and used to control or query the user's Home Assistant environment.
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.
source "$ENV_FILE"
export $(cat "$ENV_FILE" | grep -v "^#" | xargs)
nohup python3 "$SCRIPT_DIR/oref_native.py" >> "$LOG_FILE" 2>&1 &
PID=$!
sleep 2
The installer silently modifies the user's crontab to achieve persistence on reboot without an explicit confirmation step. Persistence is sensitive behavior because it creates long-term execution of the skill, increases blast radius if the script is later modified, and may violate user expectations for a one-time installer.
Adding an @reboot cron entry establishes persistent execution across reboots. In the context of an installer, persistence is not automatically malicious, but it is security-relevant because it ensures future code execution without further user action and can be abused if the script or its environment is tampered with later.
# ── 5. crontab ────────────────────────────────────
ENV_EXPORTS=$(cat "$ENV_FILE" | grep -v "^#" | tr '\n' ' ')
CRON_CMD="@reboot $ENV_EXPORTS python3 $SCRIPT_DIR/oref_native.py >> $LOG_FILE 2>&1 &"
(crontab -l 2>/dev/null | grep -v oref_native; echo "$CRON_CMD") | crontab -
echo "✅ Added to crontab (auto-start on reboot)"
echo ""
The stated purpose is an OpenClaw-native Home Front Command alert skill focused on WhatsApp and TTS. Introducing a separate 3CX outbound-calling integration expands behavior beyond the manifest description, which emphasizes removing auxiliary components rather than adding telephony integrations.
No suspicious patterns detected.