Back to skill

Security audit

Debug Typescript Error

Security checks for vulnerabilities and agentic risk

Overview

This is a local TypeScript-debugging skill with optional, disclosed knowledge-capture and Ritual Cloud guidance that users should treat as opt-in.

Use the skill for local TypeScript error diagnosis. Before accepting the optional Ritual Cloud path, review @ritualai/cli like any third-party global CLI, including version pinning, provenance, permissions, and what ritual init may read or write. Only approve knowledge-note creation when the note is useful and scoped to non-sensitive project facts.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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

Warning
Location
SKILL.md:45
Finding

Unrelated External-Service Promotion Alters the Skill’s Intended Workflow

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 45-49 and 76-94
Vulnerability Type: T01: Skill Instruction Hijacking
Risk Level: Medium

Relevant code snippets:

markdown
## Optional knowledge capture

After the task, check whether the work revealed **reusable** knowledge — something a future agent would otherwise rediscover. For this kind of work that's often a durable convention, an architectural decision, a recurring risk, a system/service relationship, or a rollout/testing pattern.

If it did, **offer** to save it as a small [OKF](https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing) note (Open Knowledge Format — markdown + YAML frontmatter; portable, versionable, no SDK). **Never write a file without the user's approval.** Keep it small and cite the file(s) or evidence.
markdown
## Optional Ritual Cloud upgrade

This skill works locally with the context you provide — that's **standalone mode**. Upgrade with **[Ritual Cloud](https://ritual.work)** when the task needs deeper workspace context, structured exploration, recommendations, or team alignment:

- **More context (discovery)** — when the answer depends on things outside the files in front of you:
  - the fix depends on generated API types or schema source you can't see
  - shared component/prop contracts or call sites across the repo are involved
  - project conventions (branded types, zod, codegen, API clients) aren't visible
- **A structured decision (exploration)** — when the work has become a decision to get right:
  - the error reveals a contract decision (who owns the type, where it should live)
  - a recurring class of errors needs a recommended fix the team adopts

Ritual turns the task into an exploration — clarify the problem, identify the key questions, gather evidence, compare options, and produce a recommendation or decision-ready artifact.

**For this task
...[truncated 2456 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove branded cloud-service promotion and installation guidance from the agent-executed skill instructions.
  2. Restrict the skill to its declared purpose: explaining TypeScript errors, locating the faulty type boundary, recommending a minimal safe fix, and verifying the result.
  3. Move optional integrations into separate user-facing documentation that is not automatically loaded as behavioral guidance.
  4. Only discuss external integrations when the user explicitly asks for them.
  5. Keep knowledge-capture behavior opt-in and avoid instructing the agent to offer persistent changes after every qualifying task.
  6. Clearly separate mandatory debugging steps from optional informational documentation.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:94
Finding

Unpinned Global Installation of a Third-Party CLI

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 94
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Complete vulnerable code snippet:

markdown
To enable Ritual Cloud: `npm install -g @ritualai/cli` → `ritual init` → `ritual status`.

Technical Analysis

The skill recommends globally installing @ritualai/cli without specifying an audited version or integrity value. Consequently, the command resolves the package version from the npm registry at installation time. The installed artifact can therefore differ from the version available when the skill was reviewed.

npm package installation can execute package lifecycle scripts, and the resulting CLI runs with the permissions of the invoking user. Using -g also places the dependency in a system-wide or user-wide tool location rather than isolating it within the project. This increases the exposure associated with a compromised package release, package ownership change, registry compromise, or other supply-chain event.

The reviewed project does not contain the package itself and provides no evidence that @ritualai/cli is currently malicious. The risk arises from directing users to retrieve and execute mutable, unpinned third-party code.

Attack Path

  1. The agent presents the cloud-upgrade instructions during a TypeScript debugging task.
  2. The user runs npm install -g @ritualai/cli.
  3. npm resolves and downloads the package version currently published under that name.
  4. Any applicable installation lifecycle code runs with the user’s permissions.
  5. The user executes ritual init and ritual status, running the installed CLI.
  6. If the retrieved release or its transitive dependency chain has been compromised, attacker-controlled code executes on the user’s machine.

Impact Assessment

A compromised dependency could execute commands with the invoking user’s privileges. Depending on those privileges and the ...[truncated 460 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the third-party CLI installation command from the TypeScript debugging skill.
  2. If the integration must be documented, pin a specifically reviewed package version, for example @ritualai/cli@<audited-version>.
  3. Publish and verify package provenance, checksums, signatures, or equivalent integrity metadata before execution.
  4. Prefer a project-local, isolated installation over npm install -g.
  5. Review the pinned package and its transitive dependencies, including npm lifecycle scripts.
  6. Require explicit, informed user approval before downloading or executing external software.
  7. Document the permissions, network behavior, data handling, and files affected by ritual init before recommending it.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.