Back to skill

Security audit

English Oral Tutor

Security checks for vulnerabilities and agentic risk

Overview

The tutor bundle is not clearly malicious, but it needs review because it can affect more than the intended tutor agent and persist a child's lesson transcripts without clear consent or retention controls.

Review before installing. Scope the timing plugin to the intended agent/session, remove the hard-coded hook log, replace developer-specific paths, and add explicit consent plus retention/deletion controls before storing transcripts, especially for a child. Treat the browser voice userscript as optional and enable it only when microphone and TTS use are acceptable.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T01 · Skill Instruction Hijacking

Error
Location
plugin/tutor-timing/index.js:57
Finding

Gateway-Wide Prompt and Role Hijacking Through Unscoped Hooks

Content
View full analysis

Vulnerability Details

File Location: plugin/tutor-timing/index.js:40-48, 57-76
Vulnerability Type: Unscoped instruction injection into agent prompts
Risk Level: High

Vulnerable Code

js
function buildContext() {
  maybeResetTimer();
  const now = Date.now();
  const elapsed = Math.floor((now - startTime) / 60000);
  const { phase, instruction } = getPhase(elapsed);
  const autoResetNote = autoReset ? "\n[Auto-reset: new lesson detected — timer was reset. This is a fresh lesson.]" : "";
  autoReset = false;

  return `[System Context]
Current timestamp: ${new Date().toISOString()}
Session elapsed: ${elapsed} minutes
Current phase: ${phase}
${instruction}
Reminder: You must strictly follow the phase above. Do not skip phases or act out of sequence.${autoResetNote}`;
}
js
register(api) {
  api.on("message_received", async () => {
    lastMessageTime = Date.now();
  });

  api.on("before_prompt_build", async () => {
    const ctx = buildContext();
    try { fs.appendFileSync("C:\\Users\\samuel\\.openclaw\\tmp\\hook-log.txt", `before_prompt_build injecting:\n${ctx}\n---\n`); } catch {}
    return { prependContext: ctx };
  });

  api.on("agent_turn_prepare", async () => {
    return { prependContext: buildContext() };
  });

  api.on("before_agent_start", async () => {
    return { prependContext: buildContext() };
  });

  api.on("session_start", async (event) => {
    const reason = event.context?.reason || "unknown";
    if (reason === "new") {
      startTime = Date.now();
      lessonDayStart = new Date().toDateString();
      lastMessageTime = Date.now();
      autoReset = false;
    }
  });
}

Technical Analysis

The plugin describes itself as a timing injector for the english-oral-teacher agent, but its prompt-related hooks do not inspect or validate an agent identifier, session owner, or workspace. Each hook returns prependContext unconditionally.

The injected content is presented as a system-context block and c ...[truncated 2294 chars]

Remediation
View remediation

Remediation Suggestions

  1. Scope every hook to the intended agent before returning injected context:
js
const TARGET_AGENT_ID = "english-oral-teacher";

function isTargetAgent(event) {
  return event?.context?.agentId === TARGET_AGENT_ID;
}

api.on("before_prompt_build", async (event) => {
  if (!isTargetAgent(event)) return;
  return { prependContext: buildContext() };
});
  1. Apply equivalent validation to message_received, session_start, and any other registered lifecycle hook so unrelated activity cannot modify tutor timing state.

  2. Use one documented prompt-injection hook rather than injecting the same context through three lifecycle hooks.

  3. Store timing state per agent and session instead of in module-level global variables. A map keyed by a validated agent ID and session ID would prevent cross-session contamination.

  4. Prefer structured, narrowly scoped metadata over authoritative wording such as “You must strictly follow.” The receiving agent's primary policy should remain authoritative.

  5. Add automated tests proving that:

    • The target tutor agent receives exactly one timing block.
    • Other agents receive no timing block.
    • Activity in one session cannot reset or advance another session's timer.
    • Missing or malformed agent identifiers result in no injection.
  6. Align openclaw.plugin.json hook declarations with the hooks actually registered by the implementation so administrators can accurately review the plugin's behavior.

T09 · Insecure Skill Coding Practices

Note
Location
plugin/tutor-timing/index.js:60
Finding

Hard-Coded Out-of-Scope Filesystem Logging

Content
View full analysis

Vulnerability Details

File Location: plugin/tutor-timing/index.js:60-65
Vulnerability Type: Unsafe absolute-path logging with suppressed errors
Risk Level: Low

Vulnerable Code

js
api.on("before_prompt_build", async () => {
  const ctx = buildContext();
  try { fs.appendFileSync("C:\\Users\\samuel\\.openclaw\\tmp\\hook-log.txt", `before_prompt_build injecting:\n${ctx}\n---\n`); } catch {}
  return { prependContext: ctx };
});

Technical Analysis

Every execution of the before_prompt_build hook attempts a synchronous append to an absolute path under the original developer's Windows profile. This write is unrelated to the plugin's essential timing function, is not disclosed as a configurable runtime requirement, and occurs outside the installed agent workspace.

The path is hard-coded rather than derived from a validated application data directory. On systems where that path exists or is redirected through attacker-controlled filesystem components, the gateway process may write persistent content to an unintended location. Although the current log content consists of timestamp and lesson-phase data rather than credentials, it still records user activity timing.

appendFileSync blocks the gateway event loop while the filesystem operation completes. Repeated prompt construction can therefore introduce avoidable latency, especially if the destination is slow or redirected. The empty catch block suppresses permission, path, storage, and I/O errors, preventing administrators from identifying the unexpected side effect.

Attack Path

  1. The extension is installed and enabled.
  2. A prompt reaches the before_prompt_build hook.
  3. The plugin builds timing context containing a timestamp, elapsed session time, phase, and reset status.
  4. The gateway synchronously appends that context to C:\Users\samuel\.openclaw\tmp\hook-log.txt.
  5. The information persists outside the configured agent workspace.
  6. A local user with access to ...[truncated 948 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the debug filesystem write from production code because it is unnecessary for phase calculation or prompt injection.

  2. If diagnostic logging is required, use the OpenClaw logging API rather than directly writing files.

  3. Make debug logging explicitly opt-in and disabled by default.

  4. Derive any log destination from a trusted, configurable application data directory. Do not embed a developer username or absolute host-specific path.

  5. Use asynchronous logging with bounded buffering or rotation to avoid blocking the gateway event loop and uncontrolled file growth.

  6. Restrict file permissions so only the gateway owner can read the log.

  7. Define retention and redaction rules for timestamp or session metadata.

  8. Do not silently discard all errors. Report failures through the application logger without exposing sensitive data.

  9. Add a test ensuring a default installation performs no filesystem writes outside its configured workspace or application log directory.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents this as the tutoring skill itself: a conversation tutor that leads English practice, corrects grammar, and teaches vocabulary during a phased 30-minute lesson. However, the supplied code does not implement conversation tutoring logic, grammar correction, or vocabulary teaching. Instead, it manages lesson timing and injects phase-specific system context into prompts at several agent lifecycle events. That timing support is related to the declared phased-session concept, so it is not wholly unrelated, but the primary behavior is materially narrower and different from the declared purpose. Additionally, the code performs an undeclared filesystem write by logging injected prompt context to a local file, which is a capability not represented in the description or permissions. Therefore this is a meaningful description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a pedagogical conversation-tutor skill with session structure and instructional behavior. The code instead is a client-side userscript providing voice interface features for a local chat UI: microphone control, browser speech recognition, text insertion into chat, optional auto-send, and reading assistant replies aloud. While this could support oral English practice, it does not itself conduct tutoring, correct grammar, teach vocabulary, or manage the described 30-minute phases. It also uses capabilities and resources not reflected in the declaration, including DOM manipulation, microphone/STT, and TTS. Therefore the description does not accurately represent the code’s actual behavior.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
in section 4 below — the agent never reads this `SKILL.md` at runtime.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
in section 4 below — the agent never reads this `SKILL.md` at runtime.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
in section 4 below — the agent never reads this `SKILL.md` at runtime.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

md
3. 30-minute minimum. Plugin enforces phase.
  4. Default to open-ended questions.
  5. No lecture, no textbook.
  6. No audio/voice output directives.
  7. One question at a time, max 2 per turn. Never stack multiple questions.
- **Session State Machine** — phase diagram and per-phase instructions
- **Response Rules** — 8 follow-up templates (rotate, never repeat), grammar

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Line L03 states that the agent's primary identity is an English conversation teacher and that every interaction is an English lesson. This imposes a specific language mode by default without indicating that the user can choose another language or opt in, which matches the language/locale policy-violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Appending every full tutor-student exchange to a transcript file without disclosure constitutes continuous covert logging. Because the content comes from a minor in an ongoing tutoring session, the privacy sensitivity and compliance risk are significantly elevated.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · workspace/TOOLS.md (reported line 36)May include surrounding context.

md
## Why Separate?

Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.

---

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README presents the skill as an English conversation tutor and frames the bundle around English-only tutoring. For the policy category, language constraints should either be optional, explicitly user-selected, or justified as region/compliance-specific; this file does not provide that opt-in or justification here.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
76% confidence
Finding

The installation instructions direct users to copy a persistent workspace template into the agent workspace, and the bundle is explicitly designed for long-running sessions. In this context, persistent files can accumulate student-identifying data, conversation history, and transcripts over time, creating privacy and retention risk if the workspace is later shared, backed up insecurely, or overwritten by tooling.

Content

Scanner excerpt · README.md (reported line 61)May include surrounding context.

Pick an agent ID (e.g. english-oral-teacher) and copy the workspace:

bash
mkdir -p ~/.openclaw/workspace/english-oral-teacher
cp -r workspace/* ~/.openclaw/workspace/english-oral-teacher/

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document states an "English-only iron rule," and later reinforces "English only. Never translate to Chinese." This is a natural-language locale/language policy constraint applied rigidly to the user interaction, without presenting user choice or documenting opt-in in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This line codifies a strict language policy in the runtime behavior, forbidding Chinese translation regardless of user need or preference. The policy does not offer a language/locale choice or explain a justified compliance reason for the restriction.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The plugin injects instructions telling the agent to write session summaries and transcripts to files, but the plugin itself does not constrain where, how, or whether such writes should occur. In an LLM-agent setting, this can induce unsafe file-creation behavior by the downstream agent, potentially causing sensitive student conversation data to be stored locally without safeguards or authorization.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description says the plugin injects timing context into an "english-oral-teacher" agent, which indicates an English-only constraint. The file does not present this as an explicit user opt-in or justified locale-specific limitation, so it may violate language/locale policy guidance.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The plugin writes injected prompt context, including session timing and phase information, to a local file even though its stated role is only prompt-context injection. This creates an undisclosed data persistence channel and could expose tutoring-session metadata or future prompt contents to other local users, processes, or logs without user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Prompt context is being written to disk without any user-facing disclosure in this code, which is especially sensitive in a tutoring skill involving a minor. Silent logging increases privacy risk because users and operators may not realize session-derived content is persisted beyond runtime.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The title and description define the resource as an English oral practice topic library, which establishes a language constraint in the skill content. Because there is no indication that the user can choose another language or explicitly opt into English-only operation, this is a natural-language locale policy concern under the stated rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code hard-codes recognition.lang = 'en-US' and configures the tool specifically for English use, which imposes a language choice rather than offering the user a selectable locale. This matches the policy category for language or locale restrictions without explicit opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly mandates logging errors and the full transcript, but provides no user-facing notice, consent flow, or retention limits. Because this is a tutoring skill for a minor, undisclosed recording and storage of conversation content materially increases privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill describes persistent cross-session storage in conversation-history and teaching-transcript files without informing the user that their data is retained across sessions. In context, the system tracks a child's prior conversations to influence future behavior, which raises privacy sensitivity and makes silent persistence more dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This instruction imposes a strict language policy of English-only interaction and forbids Chinese in all responses. The file does not present this as a user opt-in preference or clearly justify it as a documented locale-specific constraint, which makes it a natural-language policy violation under the language-choice rule.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill mandates persistent file reads and writes, including transcript and summary handling, as a hard requirement of normal tutoring flow. For an oral tutoring skill, this exceeds what is necessary to answer the user and creates avoidable data persistence and local file access risk, especially when the student is a minor.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs repeated transcript and summary writes but provides no user-facing notice that conversations are being persistently logged. Hidden logging undermines informed consent and is especially problematic in an educational setting involving a child.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Session-end instructions to write a full transcript and detailed summary create an additional persistent copy of potentially sensitive student information. In the context of a long-running tutor for a minor, these records increase exposure if accessed by unauthorized users or retained indefinitely.

Content

No source excerpt is available for this finding.