T01 · Skill Instruction Hijacking
- Location
scripts/compress.py:143- Finding
Untrusted Conversation Content Is Promoted to a Privileged System Message
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This session-compression skill mostly matches its purpose, but it needs review because it can rewrite privileged session context and silently use Google credentials to update a Sheet when local config is present.
Install only if you are comfortable with a tool that rewrites OpenClaw session history. Review or remove the Google Sheets code unless you explicitly want remote metrics, and use dry-run plus your own backups before applying compression to important sessions.
scripts/compress.py:143Untrusted Conversation Content Is Promoted to a Privileged System Message
scripts/compress.py:263Compression Implicitly Loads OAuth Credentials and Performs Authenticated Network Operations
scripts/compress.py:176Backup Replacement and Non-Atomic Session Writes Can Cause Irrecoverable Data Loss
config.yaml:14Installation Instructions Use Unpinned Third-Party Dependencies and Mutable Resources
The declared purpose is local session compression, but the finding indicates additional behaviors including writing separate tracking files and using Google Sheets API with local credentials for telemetry. Undisclosed external reporting is a serious security concern because session summaries may contain sensitive conversation data, secrets, or user content that could be exfiltrated to third parties without informed consent.
The skill’s stated purpose is local session compression, but it conditionally initializes Google Sheets access, reads a spreadsheet ID and OAuth credentials, and performs remote updates. That is a material capability expansion beyond the declared function and creates an unexpected outbound data path tied to local credential material.
Although the current Google Sheets payload contains metrics rather than raw summaries, the compression workflow handles sensitive conversation-derived data and adds an external reporting channel under benign analytics framing. In this context, any unjustified remote sink attached to sensitive session processing increases the risk of disclosure and normalizes outbound transfer in a tool users would expect to remain local.
Google Sheets API integration is not necessary for compressing local session files and introduces networked exfiltration capability into a tool that otherwise appears local-only. Even though the current payload is metrics-oriented, the added API surface and credentialed remote access materially increase risk and violate least privilege.
The script accesses OAuth credential material from a fixed local path, giving a session utility the ability to leverage authenticated Google API access. Even without stealing or printing the secrets, this is credential usage outside the core function and expands the blast radius if the tool is misused or modified.
return # Google libs not available
# Load credentials
creds_file = os.path.expanduser("~/.openclaw/workspace/config/google_credentials.json")
if not os.path.exists(creds_file):
return
The README advertises an --apply mode that appears to modify session or context data, but it does not warn users that this action may alter or overwrite conversation state. In a tool specifically designed to compress and rewrite session history, that omission increases the chance of accidental destructive use, loss of important context, or corruption of state that later affects model behavior.
The skill documentation describes operations that read, modify, back up, and restore local session files, but it does not declare any explicit tool scope or permissions boundary. That omission creates a trust gap: a user or orchestrator cannot easily tell that the skill needs file read/write access, increasing the chance of unintended file modification or abuse if the implementation touches broader paths than expected.
The description says the skill triggers on 'mentions of session compression, token reduction, context cleanup' and 'when session size exceeds safe thresholds,' but it does not define specific invocation phrases, boundaries, or exclusion conditions. Terms like 'context cleanup' and generic 'mentions' are broad enough to overlap with ordinary discussion about performance or token usage, which could cause unintended activation.
The SessionCompressor initializes with lang="french" and uses that value to construct the tokenizer, imposing a specific language setting by default. The file does not offer the user a language choice or explain why French is required, which conflicts with the locale-policy requirement.
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.
role_content[role] = []
role_content[role].append(content)
# Create summary for each role
summary_parts = []
for role in ['system', 'user', 'assistant', 'tool']:
if role in role_content:
The compressor explicitly aggregates content from prior system, user, assistant, and tool messages into a new summary message, which can preserve and restate sensitive information users previously provided. That summarized content is then retained in the session and later logged via the stats/update flow, creating a natural-language data retention and disclosure path even though it is framed as benign context compression.
The script performs external Google Sheets writes without any explicit warning or consent flow at runtime, despite operating on potentially sensitive session history. Users invoking a local compression utility may not realize it also makes authenticated outbound requests, which undermines informed consent and privacy expectations.
The script reads Google OAuth credential material from a local config path despite the advertised function being session compression. Accessing unrelated credentials broadens the trust boundary and enables authenticated external actions that users would not reasonably expect from this skill.
No suspicious patterns detected.