Back to skill

Security audit

WorldSim

Security checks for vulnerabilities and agentic risk

Overview

WorldSim is a local world-simulation skill that clearly discloses persistent local file use, with one bounded deletion-confirmation weakness users should understand.

Install only if you are comfortable with a skill that persistently reads, writes, snapshots, and sometimes deletes local world-simulation files. Keep WORLDSIM_WORLDS_DIR pointed at a dedicated WorldSim data directory, do not enter secrets or sensitive personal data into stories or character cards, and treat delete/reset/load operations carefully because one delete path depends on the agent following the confirmation workflow rather than enforcing it in code.

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/worldctl.py:3681
Finding

Destructive state deletion does not enforce the documented user-confirmation boundary

Content
View full analysis

Vulnerability Details

File Location: scripts/worldctl.py:3513-3519, scripts/worldctl.py:3681-3758, and scripts/worldctl.py:7691-7692
Vulnerability Type: Missing authorization confirmation for destructive operations
Risk Level: Medium

Relevant Code

Direct command dispatch invokes the deletion routine without requiring a confirmation token, interactive prompt, or --force flag:

python
elif args.action == "delete":
    sys.exit(0 if cmd_delete(world_dir, args.extra) else 1)

Batch operations containing a deletion marker also invoke the same routine directly:

python
for idx, (kind, file_key, key_path_str, content, append) in enumerate(ops):
    if idx in blocked:
        continue
    if kind == "delete":
        if cmd_delete(world_dir, [file_key, key_path_str]):
            written_count += 1
        else:
            op_failures.append((idx, file_key, key_path_str))
        continue

The deletion routine backs up the state file but then removes the selected key and writes the modified state without checking for user approval:

python
try:
    bak_dir = world_dir / "tmp"
    bak_dir.mkdir(parents=True, exist_ok=True)
    bak = bak_dir / f"{filepath.name}.delete.{_ts()}.bak"
    shutil.copy2(filepath, bak)
except Exception as e:
    print(f"[ERR] {e}", file=sys.stderr)
    return False

del target[last]
write_yaml(filepath, data)
return True

Technical Analysis

The Skill documentation designates direct delete operations and batch deletion markers as destructive operations that require explicit user confirmation. That authorization boundary is not implemented in worldctl.py.

Both supported deletion paths reach cmd_delete() without:

  • An interactive confirmation prompt.
  • A required --force option for non-interactive execution.
  • A short-lived confirmation token tied to the requested world and key.
  • Evidence that the us ...[truncated 2230 chars]
Remediation
View remediation

Remediation Suggestions

  1. Add a shared destructive-operation confirmation function and call it from both direct and batch deletion paths.
  2. In interactive mode, display the exact world, state file, and key path, then require an affirmative response with rejection as the default.
  3. In non-interactive mode, fail closed unless the caller supplies an explicit --force option or a scoped confirmation token.
  4. Bind any confirmation token to the world, file key, key path, and operation type so approval for one deletion cannot authorize another.
  5. Require separate approval for every batch deletion, or show the complete deletion set and approve it atomically before applying any operation.
  6. Perform confirmation before creating or modifying files, and revalidate the target after confirmation to reduce time-of-check/time-of-use inconsistencies.
  7. Preserve the existing backup and path-confinement safeguards, but treat them as recovery and containment controls rather than authorization controls.
  8. Add tests proving that direct and batch deletion fail in non-interactive mode without explicit authorization and that denial leaves all state files unchanged.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (68)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the skill primarily performs documentation scanning/linting rather than the advertised world simulation and persistence tasks, that mismatch undermines user consent and policy enforcement. In context, this is more dangerous because the skill requests broad local filesystem access and destructive operations; hidden or materially different behavior could be used to inspect or mutate files under a misleading trust model.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the skill primarily performs documentation scanning/linting rather than the advertised world simulation and persistence tasks, that mismatch undermines user consent and policy enforcement. In context, this is more dangerous because the skill requests broad local filesystem access and destructive operations; hidden or materially different behavior could be used to inspect or mutate files under a misleading trust model.

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 49)May include surrounding context.

md
- 反模式 → 正例:跑 `gate writer --check` 前先翻 `worldctl.py` 抠锚点词表 → 按 `phase_writer.md` 写完再跑 `--check`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 反模式 → 正例:跑 `gate writer --check` 前先翻 `worldctl.py` 抠锚点词表 → 按 `phase_writer.md` 写完再跑 `--check`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 查询意图(如查世界状态/角色状态/冲突/故事线等) → references/commands.md「用户命令」只读查询 → 跳过决策直接输出;

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 查询意图(如查世界状态/角色状态/冲突/故事线等) → references/commands.md「用户命令」只读查询 → 跳过决策直接输出;

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 查询意图(如查世界状态/角色状态/冲突/故事线等) → references/commands.md「用户命令」只读查询 → 跳过决策直接输出;

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 查询意图(如查世界状态/角色状态/冲突/故事线等) → references/commands.md「用户命令」只读查询 → 跳过决策直接输出;

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- 查询意图(如查世界状态/角色状态/冲突/故事线等) → references/commands.md「用户命令」只读查询 → 跳过决策直接输出;

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · templates/CHAR_.md (reported line 4)May include surrounding context.

md
# 角色名 — 身份/称号

## 基本信息(必填·头部元数据)
<!-- 创作指示:简短元数据——外部定位,不是叙事素材。姓名/性别/生日:有则填,未知留空;
     简介 = 一句话社交名片(他人如何看待他/她——第一眼标签、社会身份)。
     边界:简介(外部视角)≠ 人格内核·性格(内部视角)。角色卡导入时 name→姓名、description 的身份定位→简介。 -->

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · templates/CHAR_.md (reported line 4)May include surrounding context.

md
# 角色名 — 身份/称号

## 基本信息(必填·头部元数据)
<!-- 创作指示:简短元数据——外部定位,不是叙事素材。姓名/性别/生日:有则填,未知留空;
     简介 = 一句话社交名片(他人如何看待他/她——第一眼标签、社会身份)。
     边界:简介(外部视角)≠ 人格内核·性格(内部视角)。角色卡导入时 name→姓名、description 的身份定位→简介。 -->

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

git clone https://github.com/worldsimlife/worldsim.git

text

Then place the `worldsim` directory (or a symlink to it) in your client's skills directory — e.g. `.codex/skills/` or `.claude/skills/` for Codex / Claude Code–style clients — so the final path is `…/skills/worldsim/`.

Releases and version history: [GitHub Releases](https://github.com/worldsimlife/worldsim/releases)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README presents the main skill description entirely in Chinese and relegates English to a linked alternate file, which indicates a default language choice rather than offering users a language option in-place. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description and operating instructions are written entirely in Chinese and present the skill as a Chinese-language experience, but do not offer a user language choice or clearly justify a locale restriction. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document is written entirely in Chinese and specifies evaluation procedures and content checks around Chinese keywords, such as requiring known Chinese keywords to be grep-able in narrative.md. There is no indication that users may choose another language or that the locale restriction is required for a region-specific or compliance-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This manifest-style JSON includes a note entirely in Chinese, and the evaluation assertions explicitly require Chinese text quality. That creates a language-specific constraint in natural language without any indication that users can choose another language or that the restriction is an explicitly documented regional requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The assertion requires narrative.md to contain valid UTF-8 Chinese text with no garbling, which semantically enforces Chinese as the output language. Because no user choice or justified regional limitation is stated in this file, this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire instruction set, examples, required output fields, and formatting conventions are written as mandatory Chinese-language content, including fixed Chinese literals in output schemas and examples. There is no indication that the user may choose another language, nor any justification that this skill is region-specific or Chinese-only by design.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The title and instructional content are written entirely in Chinese, which imposes a specific language on users. Under the policy, language-specific behavior should either offer user opt-in/choice or clearly document why the locale restriction is required.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file title and command reference are written entirely in Chinese, and operational guidance such as line L018 explicitly mandates Chinese handling in command usage. There is no indication anywhere in this file that users may choose another language or locale, which can violate a language/locale policy when the skill effectively requires a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document title and all operative instructions are written in Chinese, establishing Chinese as the required working language for the skill. There is no indication that users may choose another language or opt in to this locale constraint, so the file natural-language policy appears to enforce a specific language by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document explicitly allows imported character-card content to be written to a temporary file before review, while acknowledging later that cards may contain sensitive personal information. That creates a real privacy exposure window: untrusted content may already be persisted on disk before the LLM/user can assess and reject it, and temporary files may be recoverable, backed up, or readable by other local processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The line requires world timeline entries to be written as '完整的自然中文句', which imposes a specific language requirement. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is written entirely in Chinese and presents the skill instructions as mandatory operational guidance, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.