T09 · Insecure Skill Coding Practices
- Location
src/sql_connector.py:91- Finding
SQL Server certificate validation is explicitly bypassed
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly coherent for SQL-backed OpenClaw memory dreaming, but it needs Review because it runs scheduled jobs over persistent memories, database credentials, deletion, and optional external publishing with some important security controls under-specified.
Install only if you are comfortable giving this skill scheduled access to your OpenClaw workspace and SQL memory database. Before production use, remove or override TrustServerCertificate=yes, use a least-privilege SQL account, verify backups before enabling file cleanup, keep tokens and .env/config files out of source control, and enable Confluence publishing only after reviewing page permissions and redacting sensitive memory content.
src/sql_connector.py:91SQL Server certificate validation is explicitly bypassed
scripts/pre_dream_sql_feed.py:48Database-controlled content is copied verbatim into persistent Agent memory input
requirements.txt:1Dependencies are not reproducibly pinned and the network client dependency is undeclared
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cd ~/.openclaw/workspace
# Or wherever your OpenClaw workspace is
cp .env.example .env
Edit .env and add SQL Server credentials:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from sql_connector import get_connector
db = get_connector() # Uses credentials from .env
# That's it. You can now query SQL Server.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from sql_connector import get_connector
db = get_connector() # Uses credentials from .env
# That's it. You can now query SQL Server.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from sql_connector import get_connector
db = get_connector() # Uses credentials from .env
# That's it. You can now query SQL Server.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from sql_connector import get_connector
db = get_connector() # Uses credentials from .env
# That's it. You can now query SQL Server.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
irname(os.path.abspath(__file__))))
from scripts.pre_dream_sql_feed import build_memory_content, run
SAMPLE_MEMORIES = [
{"id": 1, "category": "facts", "key_name": "ob342_complete", "content": "Memory palace configured with OB-342.", "importance": 9, "created_at": datetime(2026, 4, 25, 12, 0, tzinfo=timezone.utc)},
{"id": 2, "category": "facts", "key_name": "crontab_fixed", "content": "Crontab corrected with OB-343.", "importance": 8, "created_at": datetime(2026, 4, 25, 13, 0, tzinfo=timezone.utc)},
{"id": 3, "category": "lessons_learned", "key_name": "rule2_enforcement", "content": "Always branch before committing.", "importance": 7, "created_at": datetime(2026, 4, 25, 14, 0, tzinfo=timezone.utc)},
{"id": 4, "category": "facts", "key_name": "low_importance", "content": "Should not appear in corpus.", "importance": 3, "created_at": datetime(2026, 4, 25, 15, 0, tzinfo=timezone.utc)},
]
class TestBuildMemoryContent:
def test_returns_string(self):
result =
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.
│ │ SQL Memory (clawbot-sql-memory) │ │
│ │ ├─ Stores: facts, decisions, incidents, lessons learned │ │
│ │ ├─ Table: memory.Memories │ │
│ │ └─ Uses: SQL Connector to read/write │ │
│ └──────────────────────────────────────────────────────────┘ │
│ ↓ (daily at 3:00 AM) │
│ ┌──────────────────────────────────────────────────────────┐ │
The guide explicitly describes optional Confluence publishing of dream reports to an external service but does not warn that agent-generated memories, reports, or potentially sensitive internal content may be transmitted outside the local environment. In this context, users may enable the feature without understanding the data-sharing implications, creating a real risk of unintended data exfiltration or privacy/compliance violations.
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.
Create configuration file:
cd ~/.openclaw/workspace
The README explicitly advertises automatic pruning of dream output files older than N days, but does not give a clear warning that this permanently deletes local artifacts and may remove data needed for audit, recovery, or troubleshooting. In a scheduled unattended workflow, users may enable the feature without realizing the retention and backup implications, leading to unintended data loss.
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.
Add these entries to your crontab (crontab -e). Adjust timezone as needed (shown in EDT = UTC-4):
# Pre-dream SQL feed: populate clean memory file from SQL (30 min before dream cycle)
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.
Add these entries to your crontab (crontab -e). Adjust timezone as needed (shown in EDT = UTC-4):
# Pre-dream SQL feed: populate clean memory file from SQL (30 min before dream cycle)
The skill performs file pruning of dream outputs, but the top-level description does not prominently warn that it deletes files. In an automation context with cron and a configurable workspace path, under-documented destructive behavior increases the risk of accidental data loss or deletion of the wrong files if the path or retention settings are misconfigured.
The documentation presents optional Confluence publishing without clearly warning that dream outputs may be transmitted to an external service. Because the skill handles session logs, memories, and synthesized outputs, operators may unknowingly export sensitive or private content outside the local environment.
The documentation explicitly encourages storing 'facts/decisions/incidents' and dream synthesis outputs in SQL tables and markdown files, which can reasonably contain sensitive organizational or personal information. There are no warnings about data minimization, classification, retention, access controls, or user consent, so adopters may persist sensitive data in places that are broadly accessible or retained longer than intended.
The Confluence configuration documents publishing dream data to an external SaaS destination but provides no warning that the content may include sensitive internal memories, incident data, or derived insights. This omission increases the chance of accidental data exfiltration to a broader audience, especially if users enable publishing without understanding visibility and data handling implications.
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.
- Run `pre_dream_sql_feed.py` manually and check output
**"Cron jobs not running"**
- Check crontab: `crontab -l`
- Check logs: `tail ~/.openclaw/logs/pre_dream.log`
- Run scripts manually to see errors
The manifest explicitly states that dream output .md files older than a configured age will be deleted, but it does not prominently warn users that enabling or using the skill causes destructive filesystem behavior. In the context of a memory/archive skill, silent cleanup can lead to unintended data loss, especially if users assume the skill only archives to SQL and do not realize local files are purged afterward.
The stated skill purpose focuses on replacing file-based memory ingestion with SQL queries and archiving dream outputs to SQL while keeping the filesystem lean. Adding a separate Confluence publishing capability introduces an external content publication feature that is not justified by that stated purpose.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"space": {"key": space_key},
"body": {"storage": {"value": body, "representation": "storage"}},
}
r = requests.post(f"{self.base_url}/content", headers=self.headers, json=payload)
r.raise_for_status()
return r.json()
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"version": {"number": version + 1},
"body": {"storage": {"value": body, "representation": "storage"}},
}
r = requests.put(f"{self.base_url}/content/{page_id}", headers=self.headers, json=payload)
r.raise_for_status()
return r.json()
The script deletes all existing DreamLight rows for the selected cycle_date, which is a destructive operation affecting persisted data. Although the file includes general docstrings and prints status output, it does not clearly warn the user before execution that prior database entries for that date will be removed and replaced.
The module docstring frames the script's purpose narrowly as reading JSON phase-signal state and UPSERTing it into dreams.PhaseSignals as a backup/audit copy. However, the implementation also parses daily-ingestion.json and writes activity records into dreams.DreamCorpus, which is a separate behavior not reflected in that documentation.
The instructions tell users to create a .env file containing database credentials but do not warn them to protect that file from source control, logs, backups, or overly permissive filesystem permissions. This is a genuine secret-handling weakness in setup documentation because it normalizes storing live credentials without accompanying safeguards.
The documentation states that dream files are deleted after 7 days but does not clearly call out that this is a destructive retention policy. Users may unintentionally lose audit, debugging, or historical artifacts they expected to preserve, especially in production or incident-review contexts.
No suspicious patterns detected.