T06 · System Persistence
- Location
scripts/setup_cron.mjs:287- Finding
Unattended Cross-Session Persistence Through a Recurring OpenClaw Cron Job
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly coherent, but it installs a persistent external-reporting audit job and has report-integrity and transport risks users should review before installing.
Install only if you intend to create an unattended recurring OpenClaw audit job that sends reports to the configured DM target and optional email recipient. Review the cron payload, recipients, SMTP settings, install directory permissions, and PROMPTSEC_GIT_PULL before enabling it; prefer local sendmail or TLS-protected mail handling, keep git auto-pull disabled unless you have a verified release process, and verify deep-audit results independently until the report omission bug is fixed.
scripts/setup_cron.mjs:287Unattended Cross-Session Persistence Through a Recurring OpenClaw Cron Job
scripts/runner.sh:31Mutable Git Content Can Be Retrieved and Executed by the Persistent Runner
scripts/render_report.mjs:137Deep-Audit Critical and Warning Findings Are Omitted from the Main Report
scripts/send_smtp.mjs:34SMTP Fallback Transmits Security Audit Reports Without TLS or Authentication
scripts/run_audit_and_format.sh:63Audit Error Output Is Embedded into JSON Without Escaping
The declared description centers on an automation workflow: recurring daily audits of OpenClaw agents, cron setup/maintenance, and report distribution through DM/email. The actual code chunk instead only invokes the Codex CLI in read-only review mode against the local skill directory. Its purpose is code review of the skill itself, not operational audits of agents. There is no evidence of scheduling, cron manipulation, messaging, email sending, recipient configuration, or recurring execution. This is a material purpose and capability mismatch, not merely an implementation detail difference.
The code chunk is a local wrapper script that executes openclaw security audit and openclaw security audit --deep, then invokes render_report.mjs to format the results. Its behavior is limited to producing a formatted report on stdout. There is no logic for creating, updating, or interacting with cron; no messaging, DM, email, SMTP, webhook, or recipient-delivery functionality; and no trigger or scheduling mechanism indicating daily automated runs. The security audit/report formatting portion matches part of the description, but the declared purpose significantly overstates automation and delivery capabilities not present in this code.
The core auditing and reporting behavior generally aligns with the description: the script runs the audit workflow, formats output, prints to stdout for cron-driven delivery, and optionally emails reports. However, the declared purpose explicitly says it creates or updates a recurring cron job, and this code does not do any scheduling or cron management at all. Additionally, the script includes an undeclared capability to run git pull on the repository when enabled via environment variable. That extra behavior changes repository state and is not described. Because the cron-management claim is materially unsupported and there is an extra undeclared repo-update capability, this is a mismatch.
The declared description presents a full daily security audit system with scheduling, report generation, DM delivery, and optional email reporting. The supplied code chunk is much narrower: it is a helper script that formats and sends an email through sendmail. While email reporting is consistent with one part of the description, the script does not implement the primary declared behavior of running audits or managing cron jobs, nor does it handle DM delivery. Therefore the description materially overstates what this code chunk actually does.
Referenced artifact was not completely inspected
For standalone installs, verify the signed release manifest before trusting `SKILL.md`, `skill.json`, or the archive. The `skill.json` file is the package metad
Referenced artifact was not completely inspected
For standalone installs, verify the signed release manifest before trusting `SKILL.md`, `skill.json`, or the archive. The `skill.json` file is the package metad
The skill includes a standalone installation flow that downloads multiple artifacts from the network. Although it performs stronger-than-average signature and checksum verification, it still conditions trust on remote retrieval of the public key and release assets, which expands supply-chain risk; if users skip verification steps or the process is modified, malicious content could be installed and later persisted via cron.
RELEASE_PUBKEY_SHA256="711424e4535f84093fefb024cd1ca4ec87439e53907b305b79a631d5befba9c8"
curl -fsSL "$BASE/checksums.json" -o "$TMP_DIR/checksums.json"
curl -fsSL "$BASE/checksums.sig" -o "$TMP_DIR/checksums.sig"
curl -fsSL "$BASE/signing-public.pem" -o "$TMP_DIR/signing-public.pem"
curl -fsSL "$BASE/$ZIP_NAME" -o "$TMP_DIR/$ZIP_NAME"
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
# Use GPT-5.1 Codex Max (high reasoning). Note: some models (e.g. o3) may be blocked
# depending on the account type.
exec "$RESOLVED_CODEX_BIN" review -s read-only -m gpt-5.1-codex-max \
"Review this skill for security/reliability issues. Focus on: shell quoting, command injection, sendmail header injection, dependency checks, cron payload safety, and failure modes. Provide concrete patch suggestions (with diffs if possible)." \
-c "workdir=\"$ROOT_DIR\"" \
-c "reasoning_effort=\"xhigh\""
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
// Check if this finding matches any suppression rule
const isSuppressed = suppressions.some((rule) => {
return rule.checkId === checkId && normalizeSkillName(rule.skill) === normalizedSkillName;
});
if (isSuppressed) {
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.
# Install skill
mkdir -p ~/.openclaw/skills/openclaw-audit-watchdog
cd ~/.openclaw/skills/openclaw-audit-watchdog
# Download and extract
The skill declares required environment variables and operational behaviors but does not define an explicit tool scope such as permissions or allowed-tools. For a skill that persists a cron job, sends messages, and may perform email delivery, missing tool scoping weakens least-privilege controls and can allow broader-than-necessary capability use at runtime.
The skill explicitly creates or updates an unattended recurring cron job, which introduces persistence on the host. Even for a legitimate security tool, persistence increases risk because a misconfigured payload, compromised skill, or later environment change can cause repeated execution and repeated data exfiltration of audit results to external DM/email targets.
## Goal
Create (or update) a daily cron job that:
1) Runs:
- `openclaw security audit --json`
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
→ Remediation: Run `openclaw security audit --fix` to update
[WARN-007] Weak Permission on Config File
→ Remediation: chmod 600 ~/.openclaw/config.json
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Run `openclaw security audit --deep` for full details.
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
cp security-audit-config.example.json ~/.openclaw/security-audit.json
The trigger list includes generic phrases such as "security audit", "run audit", and "security report" that can match routine user requests not specifically intended for this skill. In a skill system where triggers influence automatic selection, overly broad activation can cause unintended execution of a persistent, externally reporting audit workflow, increasing the chance of surprise cron installation or report delivery.
No suspicious patterns detected.