Back to skill

Security audit

zqtest

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent local memory skill, but its persistent writes are broader and less enforced than its safety documentation claims.

Install only if you are comfortable with a workspace-local persistent memory graph that other skills may read or write. Do not store passwords, tokens, API keys, or other secrets in it; deletion only appends a delete record and does not scrub prior JSONL history. Treat validation as a manual check, not an enforced write barrier, unless the implementation is fixed.

Vulnerability Patterns
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ontology.py:119
Finding

Graph mutations are persisted without enforcing declared schema constraints

Content
View full analysis

Vulnerability Details

File Location: scripts/ontology.py:119-135, scripts/ontology.py:171-184, scripts/ontology.py:200-212, and scripts/ontology.py:493-527
Vulnerability Type: Schema validation bypass leading to plaintext sensitive-data storage and invalid graph state
Risk Level: Medium

Vulnerable Code

python
def create_entity(type_name: str, properties: dict, graph_path: str, entity_id: str = None) -> dict:
    """Create a new entity."""
    entity_id = entity_id or generate_id(type_name)
    timestamp = datetime.now(timezone.utc).isoformat()
    
    entity = {
        "id": entity_id,
        "type": type_name,
        "properties": properties,
        "created": timestamp,
        "updated": timestamp
    }
    
    record = {"op": "create", "entity": entity, "timestamp": timestamp}
    append_op(graph_path, record)
    
    return entity
python
def update_entity(entity_id: str, properties: dict, graph_path: str) -> dict | None:
    """Update entity properties."""
    entities, _ = load_graph(graph_path)
    if entity_id not in entities:
        return None
    
    timestamp = datetime.now(timezone.utc).isoformat()
    record = {"op": "update", "id": entity_id, "properties": properties, "timestamp": timestamp}
    append_op(graph_path, record)
    
    entities[entity_id]["properties"].update(properties)
    entities[entity_id]["updated"] = timestamp
    return entities[entity_id]
python
def create_relation(from_id: str, rel_type: str, to_id: str, properties: dict, graph_path: str):
    """Create a relation between entities."""
    timestamp = datetime.now(timezone.utc).isoformat()
    record = {
        "op": "relate",
        "from": from_id,
        "rel": rel_type,
        "to": to_id,
        "properties": properties,
        "timestamp": timestamp
    }
    append_op(graph_path, record)
    return reco
...[truncated 4680 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require and load a schema before every mutation that depends on schema guarantees.
  2. Construct a proposed in-memory graph state and validate it before calling append_op.
  3. Reject create and update operations containing forbidden properties, missing required properties, invalid enum values, or invalid property types.
  4. Reject relation creation when either endpoint does not exist or when endpoint types, cardinality, or acyclicity constraints would be violated.
  5. Ship a secure default schema containing the documented Credential restrictions and core type constraints.
  6. Make mutation and persistence atomic: append only after validation succeeds, and return a nonzero exit status on rejection.
  7. Add explicit secret-pattern defenses for credential entities so obvious secret-bearing fields cannot be persisted even when a custom schema omits the restriction.
  8. Implement actual rollback for multi-step graph transformations or revise the documentation to state that rollback is unsupported.
  9. Add regression tests confirming that forbidden Credential fields, dangling relations, invalid cardinality, cycles, and missing required properties are rejected before any data reaches the JSONL file.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 84)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 90)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 92)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 104)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 212)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 221)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 222)May include surrounding context.

md
python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/schema.md (reported line 165)May include surrounding context.

forbidden_properties: [password, secret, token, key, api_key] properties: service: string secret_ref: string # Reference to secret store (e.g., "keychain:github-token") expires: datetime? scope: string[]?

text

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill explicitly describes write behavior to local workspace files (memory/ontology/graph.jsonl, memory/ontology/schema.yaml) and directory creation, but it does not declare any tool scope such as permissions or allowed-tools. That mismatch can let an agent invoke file-writing behavior without clear policy boundaries, increasing the risk of unintended state changes, cross-skill persistence abuse, or modification of shared memory by prompts that merely mention broad ontology-related tasks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad (remember, what do I know about, link X to Y, shared state access), making accidental or over-broad invocation plausible. In this skill's context, unintended invocation is more dangerous because the skill has persistent read/write access to structured memory, so a casual conversational phrase could cause durable graph mutations or expose cross-skill stored data.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.