Back to skill

Security audit

Cinematic Script Writer

Security checks for vulnerabilities and agentic risk

Overview

The main skill does what it advertises, but users should be aware it stores story state and can upload generated files to Google Drive when authorized.

Install only if you are comfortable granting this skill memory access for your story projects and HTTP access for optional Google Drive saves. Use a Google OAuth client and scope appropriate to drive.file, review what will be uploaded before saving, and remove or ignore the bundled example/template skills if redistributing or auto-discovering nested skill manifests. Updating dev dependencies would reduce development-tooling risk.

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

Error
Location
examples/file-manager-skill/index.ts:34
Finding

Path Containment Bypass Permits File Operations Outside the Configured Base Directory

Content
View full analysis

Vulnerability Details

File Location: examples/file-manager-skill/index.ts:34-42
Vulnerability Type: Improper path containment validation
Risk Level: High

Vulnerable Code

ts
private resolvePath(filePath: string): string {
  const base = this.config.basePath || process.cwd();
  // Prevent directory traversal
  const resolved = path.resolve(base, filePath);
  if (!resolved.startsWith(path.resolve(base))) {
    throw new Error('Access denied: Path outside base directory');
  }
  return resolved;
}

The resulting path is subsequently passed to privileged filesystem operations, including fs.readFile, fs.writeFile, fs.readdir, and fs.unlink.

Technical Analysis

The code attempts to prevent directory traversal by checking whether the resolved path starts with the configured base-directory string. A string-prefix comparison does not establish that the target is a descendant of the base directory.

For example, if the configured base directory is /safe, the resolved path /safe-evil/secret.txt starts with the string /safe and therefore passes the check, even though it is outside /safe.

The check also does not canonicalize the target with realpath, so symbolic links located inside the permitted directory may potentially redirect operations outside that directory.

Attack Path

  1. The file-manager example is enabled with basePath set to /safe.
  2. An attacker or untrusted caller identifies or creates a sibling directory whose name shares the base prefix, such as /safe-evil.
  3. The caller supplies a path such as ../safe-evil/secret.txt.
  4. path.resolve('/safe', '../safe-evil/secret.txt') produces /safe-evil/secret.txt.
  5. /safe-evil/secret.txt.startsWith(/safe) evaluates to true.
  6. The containment check accepts the path.
  7. Depending on the invoked tool, the code reads, writes, enumerates, or deletes the out-of-scope target.

A symbolic-link va ...[truncated 1390 chars]

Remediation
View remediation

Remediation Suggestions

Replace string-prefix validation with a path-relative containment check that enforces directory boundaries:

ts
private resolvePath(filePath: string): string {
  const base = path.resolve(this.config.basePath || process.cwd());
  const target = path.resolve(base, filePath);
  const relative = path.relative(base, target);

  if (
    relative === '..' ||
    relative.startsWith(`..${path.sep}`) ||
    path.isAbsolute(relative)
  ) {
    throw new Error('Access denied: Path outside base directory');
  }

  return target;
}

Additional hardening should include:

  1. Canonicalize the base directory with fs.realpath.
  2. For existing targets, canonicalize the target and repeat the containment check using canonical paths.
  3. For new files, canonicalize the nearest existing parent directory before writing.
  4. Reject or safely handle symbolic links when strict sandboxing is required.
  5. Open files with protections such as O_NOFOLLOW where supported and appropriate.
  6. Add regression tests covering prefix-sharing siblings, .. traversal, absolute paths, mixed separators, and symlink escapes.
  7. Run the Skill under a minimally privileged operating-system account so a containment failure cannot expose unrelated sensitive files.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (87)

Known Vulnerable Dependency: handlebars==4.7.8 — 8 advisory(ies): CVE-2026-33916 (Handlebars.js has Prototype Pollution Leading to XSS through Partial Template In); CVE-2026-33937 (Handlebars.js has JavaScript Injection via AST Type Confusion); CVE-2026-33938 (Handlebars.js has JavaScript Injection via AST Type Confusion by tampering @part) +5 more

Critical
Category
Supply Chain
Confidence
91% confidence
Finding

handlebars 4.7.8 has multiple serious advisories including prototype pollution and potential code/script injection paths, making it the most concerning item in this lockfile. It appears under ts-jest as a dev dependency, which lowers direct runtime exposure for the cinematic-script-writer skill, but if templates are compiled from untrusted content anywhere in CI, tooling, or future features, this could enable significant compromise or XSS/code-generation abuse.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Generic greeting, memory storage, and arithmetic behavior unrelated to the declared cinematic purpose indicate either template residue or concealed extra functionality. Even if not directly exploitable, this mismatch undermines trust, increases attack surface, and suggests the implementation was not reviewed against its published contract.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The implementation is a generic local file manager, which is materially different from the declared cinematic script-writing purpose. This capability mismatch is dangerous because it can grant an agent broad read/write/delete access to the host filesystem under the guise of an unrelated creative skill, increasing the chance of covert data access or destructive actions that users and reviewers would not expect.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill exposes local file deletion despite no justified need for deletion in a cinematic script-writing workflow. In this context, delete capability is especially risky because a user invoking a writing assistant would not reasonably expect it to remove host files, creating a path for accidental or abusive destructive actions within the configured base directory.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest describes a generic todo-list skill with filesystem read/write permissions, which does not match the stated skill context of a cinematic script writer. This mismatch is dangerous because it can mislead reviewers and users about the skill’s actual purpose, hide unexpected capabilities, and enable unauthorized local data access under a benign-seeming cover story.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code implements a weather-fetching skill, but the declared skill metadata says this package is for cinematic script writing, image prompts, cinematography guidance, and Google Drive saving. This mismatch is a real security concern because capability/manifest deception can hide unexpected network behavior and secret usage from reviewers and users, increasing the risk of unauthorized data access or supply-chain abuse.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: brace-expansion==1.1.12 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
86% confidence
Finding

brace-expansion 1.1.12 has multiple DoS-style issues involving pathological brace patterns that can trigger excessive CPU or memory consumption. Although this instance is transitive and primarily in dev tooling, packages like glob/minimatch commonly process pattern strings, so if attacker-influenced patterns ever reach tooling or server-side utilities, they could hang or crash the process.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: minimatch==3.1.2 — 3 advisory(ies): CVE-2026-27904 (minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regu); CVE-2026-26996 (minimatch has a ReDoS via repeated wildcards with non-matching literal in patter); CVE-2026-27903 (minimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adja)

High
Category
Supply Chain
Confidence
89% confidence
Finding

minimatch 3.1.2 is reported vulnerable to ReDoS via crafted glob/extglob patterns that cause catastrophic backtracking or combinatorial matching cost. In this repository it appears only as a transitive dependency of developer tooling, so exploitability is limited, but if any service path or user-controlled pattern matching uses the same dependency chain, it can still lead to denial of service.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==3.14.2 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
82% confidence
Finding

js-yaml 3.14.2 has parser-related CPU exhaustion issues that can be triggered by malicious YAML documents, especially with merge-key constructs. Here it is nested under development/test tooling, so it is not clearly exposed by the cinematic-script-writer skill itself, but it remains a real vulnerable component in the dependency tree.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: brace-expansion==2.0.2 — 4 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-33750 (brace-expansion: Zero-step sequence causes process hang and memory exhaustion); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro) +1 more

High
Category
Supply Chain
Confidence
84% confidence
Finding

brace-expansion 2.0.2 carries the same class of denial-of-service issues as the 1.x branch, allowing specially crafted patterns to consume excessive resources. Even though this copy is transitive and likely developer-tooling related, vulnerable pattern expansion libraries are still a real weakness when exposed to attacker input.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: browserslist==4.28.1 — 2 advisory(ies): CVE-2026-73088 (Browserslist: Uncaught crash / prototype write via untrusted browserslist-stats.); CVE-2026-73089 (Browserslist: Unbounded memory growth (no cache eviction) via distinct query res)

High
Category
Supply Chain
Confidence
80% confidence
Finding

browserslist 4.28.1 is reported with crash/prototype-write and memory-growth issues when handling untrusted stats or many distinct queries. In this repository it is part of the build/test ecosystem rather than the cinematic script runtime, reducing immediate risk, but the component itself is genuinely vulnerable if fed attacker-controlled data.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: flatted==3.3.3 — 2 advisory(ies): CVE-2026-32141 (flatted vulnerable to unbounded recursion DoS in parse() revive phase); CVE-2026-33228 (Prototype Pollution via parse() in NodeJS flatted)

High
Category
Supply Chain
Confidence
80% confidence
Finding

flatted 3.3.3 is flagged for unbounded recursion DoS and prototype pollution during parse/revive operations. In this lockfile it is only a transitive developer dependency, so exploitability in the skill is unclear, but if malicious serialized input reaches this parser in any tooling or service context it can crash processes or corrupt object behavior.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
83% confidence
Finding

js-yaml 4.1.1 is affected by CPU exhaustion issues from crafted YAML constructs, so it is a real vulnerable component. In this repository it is associated with linting/tooling dependencies rather than the advertised script-writing functionality, which reduces direct exposure but does not eliminate the underlying risk if tooling ingests untrusted YAML.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implemented behavior materially differs from the declared cinematic-script-writer purpose: it provides greeting, persistent memory writes, and arithmetic/expression evaluation instead of script-writing tools. This mismatch is dangerous because users and orchestration systems may grant the skill trust or permissions based on the manifest, while the actual code exposes unrelated capabilities that can be abused or indicate a bait-and-switch package.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest describes a generic template skill rather than the advertised cinematic script writer capability, indicating the package metadata does not match its stated purpose. This mismatch can conceal actual behavior from reviewers and users, undermining trust and making it easier for unnecessary or risky functionality to slip through unnoticed.

Content

No source excerpt is available for this finding.

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · skills/cinematic-script-writer/README.md (reported line 173)May include surrounding context.

md
- `createContext()` - Create story world
- `listContexts()` - List all contexts
- `getContext()` - Get specific context
- `deleteContext()` - Delete context

### Story Generation
- `generateStoryIdeas()` - Generate story ideas

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · skills/cinematic-script-writer/SKILL.md (reported line 142)May include surrounding context.

md
- `createContext()` - Create story world
- `listContexts()` - List all contexts
- `getContext()` - Get specific context
- `deleteContext()` - Delete context

### Story Generation
- `generateStoryIdeas()` - Generate story ideas

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 · skills/cinematic-script-writer/index.ts (reported line 1435)May include surrounding context.

ts
era: string,
  style: string
) {
  return promptBuilder.createCharacterReference(
    characterId,
    characterName,
    visualDescription,

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 · skills/cinematic-script-writer/index.ts (reported line 1470)May include surrounding context.

ts
era: string,
  style: string
) {
  return promptBuilder.createCharacterReference(
    characterId,
    characterName,
    visualDescription,

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 · skills/cinematic-script-writer/index.ts (reported line 1489)May include surrounding context.

ts
era: string,
  style: string
) {
  return promptBuilder.createCharacterReference(
    characterId,
    characterName,
    visualDescription,

Static analysis

No suspicious patterns detected.