T09 · Insecure Skill Coding Practices
- Location
scripts/rebuild_sqlite.py:257- Finding
Path Traversal Through an Unvalidated Transcript Timestamp
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent local token-audit skill, but it needs review because it can persistently scan sensitive session transcripts and has a real path-handling bug that may write outside its intended folder.
Install only if you are comfortable with a local tool reading completed OpenClaw session transcripts and storing derived usage ledgers. Prefer manual rebuilds until the timestamp filename validation and output-path containment bug is fixed; enable the hook only if you explicitly want ongoing automatic scans, and remove the hook when you no longer need it.
scripts/rebuild_sqlite.py:257Path Traversal Through an Unvalidated Transcript Timestamp
The skill instructs use of local files and executable commands (python3, sqlite3) and references assets that are rebuilt and written locally, but it does not declare any explicit tool scope such as allowed tools or permissions. That mismatch creates an authorization ambiguity: an agent may read environment data or modify local files more broadly than intended when fulfilling the workflow, especially because the skill explicitly mentions rebuild/update operations.
The instructions direct the user to install persistent workspace hooks under ~/.openclaw, causing the behavior to survive beyond a single session and run on future events automatically. Persistent installation is not inherently malicious, but in this context it increases the risk of unnoticed long-term transcript processing and accumulation of sensitive derived data.
- `/stop`
- gateway startup
## Files to create in your workspace
Create a hook folder:
The documented hook changes the skill from a user-invoked local analysis tool into an automatically triggered monitor that scans session transcript files and maintains derived ledgers on multiple lifecycle events. That broadens data collection and persistence behavior beyond ad hoc inspection, increasing privacy risk and attack surface if sensitive transcript content is processed or retained without explicit, informed consent.
The hook description states that completed transcript content is logged from session files and that ledger files are written automatically, but it does not provide a clear privacy warning or data-handling disclosure. Because transcripts may contain secrets, prompts, or personal data, silent background processing and persistence can expose sensitive information to unintended local readers or future tools.
The hook executes a local Python subprocess automatically during routine events, which introduces code-execution capability not strictly required for a read-only audit skill. Even though the command is fixed and local, auto-executing a script expands the trust boundary and can become dangerous if the script, its dependencies, or the target skill directory are modified.
Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
provider, agent, channel, started_at, ended_at, input_tokens, output_tokens, total_tokens,
cache_read_tokens, cache_write_tokens, billing_mode, cost_applicable, estimated_cost_usd, pricing_note,
usage_entries, bad_lines, total_lines, was_reset_file, reset_source, updated_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(
record['session_id'], record['date'], n, record.get('session_key'), record['file_path'], ledger_file,
record.get('model'), record.get('provider'), record.get('agent'), record.get('channel'),
The script embeds all diagnostic narrative strings in Chinese and emits them unconditionally in generated reports. This imposes a specific language on users without offering a locale option, which matches the language/locale policy violation criteria.
This code writes generated report content to a user-specified path or an automatically created path via Path(args.output).write_text(text). Although the CLI option names imply saving, there is no explicit warning, confirmation, or inline comment/docstring disclosing that a file will be created or overwritten at the chosen path.
No suspicious patterns detected.