Back to skill

Security audit

CloakClaw

Security checks for vulnerabilities and agentic risk

Overview

This privacy skill is coherent, but it automatically processes sensitive documents through a globally installed external tool with broad triggers and some under-disclosed local persistence risks.

Install only if you are comfortable with a globally installed `cloakclaw` executable receiving original sensitive documents and creating reversible local mappings. Prefer explicit opt-in use, verify and pin the executable version yourself, consider disabling network access while processing sensitive files, and avoid giving it regulated or highly confidential data unless you have reviewed the underlying tool and storage behavior.

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

Error
Location
SKILL.md:8
Finding

Always-On Skill Behavior and Mandatory Branded Output Injection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 8-9, 81-89, and 112-117
Vulnerability Type: T01: Skill Instruction Hijacking
Risk Level: High

Relevant code snippets (SKILL.md, lines 8-9):

yaml
Always-on by default.
Requires: Node.js 22+, CloakClaw installed (`npm install -g cloakclaw`).

Relevant code snippet (SKILL.md, lines 81-89):

markdown
**Always cloak (sensitive content in text):**
- Contains SSN patterns (###-##-####)
- Contains dollar amounts > $1,000
- Contains multiple proper names + company names
- Contains IP addresses, API keys, or passwords
- User explicitly says "cloak", "private", "redact", or "protect"

**Skip cloaking:**
- Simple questions with no sensitive data

Relevant code snippet (SKILL.md, lines 112-117):

markdown
### Step 4: Deliver with privacy footer

Append to the response:

🔒 CloakClaw: {entityCount} entities protected | Profile: {profile} | Session: {sessionId_short}

text

Technical Analysis

The Skill declares itself always-on and directs the agent to automatically intercept qualifying user content. It also requires the agent to append a stable, branded footer to processed responses. These instructions modify the agent's normal session behavior and final output even when the user has not explicitly invoked the privacy-processing operation for that individual request.

The presence of opt-out commands reduces persistence but does not eliminate the issue because automatic processing is the default. The mandatory footer is not required to perform redaction or restoration and causes agent output to include promotional text and session metadata.

No evidence was found that these instructions alter global safety constraints, write persistent memory, or obtain operating-system privileges. The affected scope is the active agent session and responses produced while the Skill is enabled.

Attack Path

1 ...[truncated 1168 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make cloaking explicitly opt-in rather than always-on.
  2. Require confirmation before processing each document or sensitive text block, particularly when the user did not directly request cloaking.
  3. Clearly disclose that content will be passed to the locally installed cloakclaw executable before invoking it.
  4. Remove the mandatory branded footer. If processing metadata is operationally necessary, use a neutral notice and display it only when requested or explicitly enabled.
  5. Avoid exposing session identifiers in routine responses unless they are required for a user-requested follow-up operation.
  6. Scope activation to the current request and reset the processing state afterward rather than maintaining broad session-wide behavior.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:10
Finding

Unpinned Globally Installed Executable Handles Sensitive Documents

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 10-12 and 18-25; scripts/cloak.js, lines 45-50; scripts/decloak.js, lines 39-44
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

Relevant code snippet (SKILL.md, lines 10-12):

yaml
Optional: Ollama for name/company detection (works without in regex-only mode).
Optional: poppler for better PDF extraction (`brew install poppler`).
install: npm install -g cloakclaw

Relevant code snippet (SKILL.md, lines 18-25):

bash
## Prerequisites

```bash
# Required
npm install -g cloakclaw

# Optional but recommended
brew install poppler       # Better PDF text extraction
ollama pull qwen2.5:7b     # AI-powered name/company detection
text

**Relevant code snippet (`scripts/cloak.js`, lines 45-50):**
```javascript
const result = execFileSync('cloakclaw', cliArgs, {
  encoding: 'utf-8',
  timeout: 60_000,
  maxBuffer: 10 * 1024 * 1024,
});

console.log(result);

Relevant code snippet (scripts/decloak.js, lines 39-44):

javascript
const result = execFileSync('cloakclaw', cliArgs, {
  encoding: 'utf-8',
  timeout: 60_000,
  maxBuffer: 10 * 1024 * 1024,
});

console.log(result);

Technical Analysis

The installation instructions use npm install -g cloakclaw without an exact version or integrity constraint. Consequently, installation resolves whatever package version the registry currently serves. The package is installed globally and then invoked by name through the environment's executable search path.

Nearly all security-sensitive operations—including detection, replacement, mapping storage, and restoration—are delegated to this external executable. The audited project does not contain the dependency's implementation, so its claimed encryption, telemetry, retention, and local-only behavior cannot be verified from the reviewed files.

execFileSync with an a ...[truncated 2069 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin cloakclaw to an exact, reviewed version instead of installing the latest available release.
  2. Use a project-local dependency with a committed lockfile and verified npm integrity metadata rather than a global installation.
  3. Review and retain the dependency source corresponding to the pinned artifact, particularly its installation scripts, telemetry, mapping storage, encryption, retention, and network behavior.
  4. Avoid resolving the executable from an uncontrolled PATH. Resolve and validate the expected local binary path before execution.
  5. Install with npm lifecycle scripts disabled when they are not required, and document any scripts that must run.
  6. Run the processor with least privilege in a restricted environment with unnecessary network access disabled.
  7. Add provenance or signature verification for released artifacts and establish a controlled dependency-update review process.
  8. Inform users that a third-party executable receives the original sensitive content before processing begins.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill declares itself 'Always-on by default' and says to use it whenever documents or sensitive-looking text are present, which creates broad automatic activation without an explicit consent or confirmation step. In a privacy proxy, this can cause unintended processing, storage of reversible mappings, and forwarding of transformed content when the user may not have intended the tool to engage.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
- **legal** — contracts, NDAs, filings (10 types)
- **financial** — bank statements, P&L, investor docs (11 types)
- **email** — correspondence (10 types)
- **code** — .env files, configs, infra docs (9 types)
- **medical** — HIPAA-adjacent records (11 types)

## Auto-Detection Rules

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The auto-detection rules rely on broad heuristics such as document type, common legal/financial keywords, dollar amounts, names, and vague user phrases like 'private' or 'protect'. Because these triggers are not tightly constrained, the skill may activate on benign content, process more data than necessary, and create decloaking sessions for material the user did not intend to route through this mechanism.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

When the input is not an existing file path, the script writes raw response text to a temporary file on disk before passing it to the decloaking CLI. In a privacy-focused skill handling sensitive legal, financial, medical, and credential-like data, this creates an avoidable exposure window where plaintext may be recoverable from the filesystem, backups, crash artifacts, or by other local processes, and the script does not warn the user that disk persistence will occur.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The script invokes the external cloakclaw binary via execFileSync, which is a subprocess operation covered by the warning criteria for code files. While the header notes that cloakclaw must be installed, it does not clearly warn the user that the wrapper will execute that external command on their supplied data.

Content

No source excerpt is available for this finding.