Back to skill

Security audit

continuity-kernel

Security checks for vulnerabilities and agentic risk

Overview

This skill transparently provides local continuity memory and evaluation tooling, with meaningful privacy and prompt-context risks that are expected for its stated purpose.

Install only if you want durable local continuity memory. Keep the database path private, avoid storing secrets or highly sensitive profile data, and ensure any integration treats continuity fields as untrusted context that cannot override higher-priority instructions.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T02 · Agent Memory Poisoning

Warning
Location
injector.py:519
Finding
Persistent Continuity State Can Poison Future Model Context## Vulnerability Details **File Location**: `store.py:183-221`, `store.py:226-273`, `injector.py:519-586`, `service.py:221-234` **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: Medium ### Vulnerable Code ```python # store.py:183-221 def upsert_soul_card( self, agent_id: str, role: str, persona: str, user_profile: str, preferences: Optional[dict[str, Any]] = None, constraints: Optional[dict[str, Any]] = None, ) -> bool: try: preferences_json = self._encode_obj( preferences, "preferences_encode_fallback", {"agent_id": agent_id}, ) constraints_json = self._encode_obj( constraints, "soul_constraints_encode_fallback", {"agent_id": agent_id}, ) with self._connect() as conn: conn.execute( """ INSERT INTO soul_card_v1 ( agent_id, role, persona, user_profile, preferences_json, constraints_json, updated_at, schema_version ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(agent_id) DO UPDATE SET role = excluded.role, persona = excluded.persona, user_profile = excluded.user_profile, preferences_json = excluded.preferences_json, constraints_json = excluded.constraints_json, updated_at = excluded.updated_at, schema_version = excluded.schema_version; """, ( agent_id, role, persona, user_profile, preferences_json, constraints_json, utc_now_iso(), SCHEMA_VERSION, ...[truncated 5821 chars]
Remediation
## Remediation Suggestions 1. Require authentication and per-agent authorization for every operation that creates or changes continuity state. 2. Record each field's source, owner, creation time, and trust level, and reject records lacking valid provenance. 3. Add integrity protection, such as keyed signatures, so unauthorized database changes are detected before injection. 4. Represent continuity values as explicitly untrusted quoted data rather than instruction-bearing text. 5. Add a model-facing policy stating that continuity data cannot override system, developer, safety, or current-user instructions. 6. Use strict schemas and field-specific length limits; reject unexpected keys and control-oriented structures. 7. Consider filtering common prompt-control patterns as defense in depth, while not relying on pattern matching as the primary security boundary. 8. Maintain an audit trail for state changes and support revocation or rollback of suspicious records. 9. Separate continuity state by tenant and agent identity to prevent cross-agent record access. 10. Add tests that store adversarial instructions in every injectable field and verify that the integration treats them only as untrusted data.

T09 · Insecure Skill Coding Practices

Note
Location
runtime_hooks.py:55
Finding
Plaintext Continuity Database Is Created Without Explicit Owner-Only Permissions## Vulnerability Details **File Location**: `runtime_hooks.py:55-80`, `store.py:66-68`, `store.py:137-166` **Vulnerability Type**: Insecure local storage of potentially sensitive data **Risk Level**: Low ### Vulnerable Code ```python # runtime_hooks.py:55-80 @classmethod def _resolve_default_db_path(cls, db_path: str | None = None) -> str: if isinstance(db_path, str) and db_path.strip(): return db_path.strip() env_path = os.environ.get(DEFAULT_DB_PATH_ENV, "").strip() if env_path: return env_path return str(DEFAULT_DB_PATH) @classmethod def _default_store(cls, diagnostics: FailOpenDiagnostics, db_path: str | None = None) -> ContinuityStore: resolved = cls._resolve_default_db_path(db_path=db_path) if resolved == ":memory:": return ContinuityStore(resolved, diagnostics=diagnostics) expanded = Path(resolved).expanduser() try: expanded.parent.mkdir(parents=True, exist_ok=True) except Exception as exc: diagnostics.emit( component="runtime_hooks", code="default_db_parent_mkdir_error", detail="Failed to create default continuity DB parent directory.", context={"db_path": str(expanded), "error": str(exc)}, ) return ContinuityStore(str(expanded), diagnostics=diagnostics) ``` ```python # store.py:66-68 def _connect(self) -> sqlite3.Connection: conn = sqlite3.connect(self.db_path) conn.row_factory = sqlite3.Row return conn ``` ```python # store.py:137-166 def migrate(self) -> bool: try: with self._connect() as conn: conn.executescript( """ CREATE TABLE IF NOT EXISTS soul_card_v1 ( agent_id TEXT PRIMARY KEY, role TEXT NOT NULL, persona TEXT NOT NULL, user_profile TEXT NOT NULL, ...[truncated 2804 chars]
Remediation
## Remediation Suggestions 1. Create the state directory with owner-only mode `0700`. 2. Create the database with mode `0600` and reapply that mode after creation. 3. Set a restrictive umask during sensitive file creation without unexpectedly changing process-wide state. 4. Use `lstat()` and safe file-opening practices to reject symbolic links where supported. 5. Verify that existing directories and database files are owned by the expected user before use. 6. Reject paths located in world-writable directories unless explicitly enabled for testing. 7. Validate environment-selected paths and document the security consequences of overriding the default. 8. Consider application-level encryption if local users, backups, or disk snapshots are within the threat model. 9. Document clearly that continuity records are persisted in plaintext. 10. Add tests that initialize storage under permissive umasks and confirm that final directory and file modes remain owner-only.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
SQLite database creation, schema migration, and persistent storage of agent profile or mission data are sensitive capabilities that should be clearly disclosed. When presented instead as a continuity kernel for llm_input injection and receipts, the skill obscures durable state handling that could retain sensitive task context or alter future behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill declares no explicit tool scope or permissions, yet the described commands and runtime defaults clearly imply environment-variable use plus filesystem reads and writes. That mismatch weakens least-privilege controls and can cause an agent or reviewer to underestimate the skill's access to local state and artifacts.

Ssd 1

Medium
Confidence
94% confidence
Finding
Framing 'llm_input injection' as a benign continuity feature is itself a security red flag because it normalizes prompt-injection-like behavior on a highly sensitive interface. In the context of an agent skill involving hooks, memory, and fail-open semantics, this language encourages bypass of normal trust boundaries and could be used to justify hidden instruction insertion into model input.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest describes a continuity kernel for fail-open llm_input injection, deterministic runtime contracts, and shadow-mode eval receipts. In this file, the implemented behavior is limited to calculating benchmark metrics, generating deterministic JSON payloads and hashes, comparing report deltas, and writing reports to disk, with no evident injection or receipt-handling behavior.

Context-Inappropriate Capability

Medium
Confidence
82% confidence
Finding
The manifest emphasizes runtime contracts, llm_input injection, and eval receipts, but does not suggest persistent local file output as part of the skill's purpose. This file creates directories and writes JSON reports to disk, which is a broader operational capability than the stated kernel behavior implies.

Description-Behavior Mismatch

Medium
Confidence
87% confidence
Finding
The manifest claims the skill provides an 'OpenClaw continuity kernel for fail-open llm_input injection, deterministic runtime contracts, and shadow-mode eval receipts.' In contrast, this module performs lexical keyword extraction and heuristic scoring of mission/tool-input alignment, including special-case boosting for 'exec' intents, which is a different functional purpose than continuity management, runtime contracts, or eval receipt generation.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The scorer gives a special positive boost to inputs beginning with 'exec', even when lexical overlap is sparse, which can inflate alignment scores for execution-oriented requests that should otherwise be treated as suspicious or out-of-mission. In a continuity kernel context, this weakens drift detection and can create a fail-open path where dangerous command-execution intents are misclassified as aligned and permitted.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The manifest describes an 'OpenClaw continuity kernel' for fail-open llm_input injection, deterministic runtime contracts, and shadow-mode eval receipts. In this file, the implemented behavior is a standalone benchmark/report generator that evaluates hard-coded runs, computes deterministic hashes, and writes a JSON artifact under the user's home directory cache, which is materially different from a runtime kernel or injection-oriented component.

Context-Inappropriate Capability

Medium
Confidence
82% confidence
Finding
The stated purpose centers on continuity, llm_input injection, runtime contracts, and eval receipts, but this file exercises drift classification using an 'exec' tool invocation carrying a shell-like command string. Even if used for testing, introducing command-execution semantics is not an obvious requirement of a continuity proof generator and represents a capability outside the manifest's clearly stated scope.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The script writes a persistent artifact containing runtime metadata and diagnostics into the user's home cache directory outside the temporary workspace. Even if intended as a proof receipt, this expands the skill's behavior into durable host-side state, which can leak sensitive operational context, create unintended tracking artifacts, or be abused by a deceptive skill to persist data beyond the declared continuity-testing scope.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The data models and corresponding CRUD methods handle persona, user_profile, preferences, constraints, and mission-tracking state. Persisting this kind of profile and mission memory is not an obvious or necessary capability for a skill described only in terms of fail-open input injection, runtime contracts, and shadow-mode eval receipts.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest says the skill is for 'fail-open llm_input injection, deterministic runtime contracts, and shadow-mode eval receipts,' which suggests runtime mediation and evaluation plumbing. This module instead creates, updates, and reads persistent 'Soul Card' and 'Mission Ticket' records containing agent persona, user profile, preferences, constraints, mission, and status, which is a materially different storage capability not expressed in the description.

Static analysis

No suspicious patterns detected.