Back to skill

Security audit

L76 Core Arch

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a skill-template package, not a data stealer, but it includes unsafe production-style examples for shell commands, file changes, external API calls, and persistent state with weak safety guidance.

Use this only as a reference after manual review. Do not copy the advanced examples directly into a real skill unless you replace shell-string exec patterns with safer APIs, add explicit confirmations for file and Git mutations, redact logs and reports, and treat state, cache, report, and memory outputs as persistent sensitive data.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/examples-advanced.md:353
Finding

Shell Command Injection in Reusable Production Templates

Content
View full analysis

Vulnerability Details

File Location: references/examples-advanced.md:88-90, 128-130, 353-355, 566-568, 581-583, 742-744; references/extension-points.md:132-135, 509-513
Vulnerability Type: OS command injection through unsafe shell-string construction
Risk Level: High

The affected documentation presents these examples as complete, production-ready patterns. The packaged index.js does not invoke them directly, but applications that copy or extend these templates can expose command execution to untrusted options, configuration values, filenames, API parameters, report definitions, and log content.

Vulnerable Code

references/examples-advanced.md:88-90:

javascript
const result = await exec({ 
  command: `cat ${options.input}` 
});

references/examples-advanced.md:128-130:

javascript
const result = await exec({ 
  command: `iconv -f UTF-8 -t ASCII//TRANSLIT ${options.input}` 
});

references/examples-advanced.md:353-355:

javascript
const result = await exec({
  command: `curl -s -X ${method} ${endpoint} ${this.formatHeaders(headers)} ${this.formatData(data)}`
});

references/examples-advanced.md:566-568:

javascript
case 'exec':
  const result = await exec({ command: section.command });
  return result.stdout;

references/examples-advanced.md:581-583:

javascript
async fetchGitData(command) {
  const result = await exec({ command: `git ${command}` });
  return result.stdout;
}

references/examples-advanced.md:742-744:

javascript
case 'exec':
  const result = await exec({ command: item.command });
  return { output: result.stdout, exitCode: result.exitCode };

references/extension-points.md:132-135:

javascript
const result = await exec({ 
  command: `find ${dir} -name "${pattern}" -type f`
});

references/extension-points.md:509-513:

javascript
try {
  await exec({ 

...[truncated 3216 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not construct shell commands from variable strings.
  2. Replace shell-based file reads, writes, copies, directory creation, cache deletion, and logging with Node.js filesystem APIs such as:
    • fs.promises.readFile
    • fs.promises.copyFile
    • fs.promises.mkdir
    • fs.promises.unlink
    • fs.promises.appendFile
  3. Use a native HTTP client such as fetch rather than invoking curl.
  4. Where an external process is necessary, use an argument-array API with shell processing disabled, for example spawn(binary, args, { shell: false }).
  5. Apply strict allowlists:
    • Restrict HTTP methods to explicitly supported values.
    • Parse endpoints with URL and restrict protocols and destinations as required.
    • Validate paths against an approved workspace root using canonical paths.
    • Restrict Git operations to known subcommands and validated arguments.
    • Reject report types that permit arbitrary command execution.
  6. Remove the generic exec batch processor and section.command functionality. Replace them with named, narrowly scoped operations.
  7. If command execution is an essential extension point, require a trusted static command identifier mapped internally to fixed binaries and fixed argument schemas.
  8. Avoid logging complete headers, request bodies, options, errors, or state without redacting credentials and sensitive fields.
  9. Add adversarial tests covering command separators, quotes, substitutions, redirections, leading option characters, traversal sequences, and malicious filenames.
  10. Stop describing the affected snippets as production-ready until safe implementations and explicit trust-boundary documentation are provided.

T09 · Insecure Skill Coding Practices

Note
Location
index.js:181
Finding

Dry-Run Mode Performs Undocumented Persistent State Writes

Content
View full analysis

Vulnerability Details

File Location: references/examples.md:16-21; index.js:43-49, 136-140, 181-188
Vulnerability Type: Failure of dry-run safety guarantees and unexpected persistent state modification
Risk Level: Low

Vulnerable Code

references/examples.md:16-21 documents dry-run mode as having no side effects:

bash
# Verbose output
node index.js --verbose

# Dry run (no side effects)
node index.js --dry-run

index.js:43-49 persists state to disk:

javascript
save() {
  try {
    fs.writeFileSync(this.stateFile, JSON.stringify(this.state, null, 2));
  } catch (error) {
    console.warn(`Failed to save state: ${error.message}`);
  }
}

index.js:136-140 always updates state during initialization:

javascript
async initialize(options) {
  console.log('📦 Initializing...');
  // Initialize resources, load config, etc.
  this.state.update({ config: options });
}

index.js:181-188 skips only preflight checks in dry-run mode and still executes the normal initialization path:

javascript
// Run preflight
if (!options.dryRun) {
  await executor.preflight();
}

// Execute main logic
const result = await executor.execute(options);

Technical Analysis

The --dry-run option is parsed correctly, but it controls only whether preflight() executes. It does not disable execute(), initialize(), StateManager.update(), or StateManager.save().

As a result, a dry run modifies:

  • config
  • lastRun
  • runCount
  • The on-disk state.json file

This violates the documented guarantee that dry-run mode has no side effects. It also establishes an unsafe base-class pattern for derived Skills: subclasses may assume that --dry-run prevents writes or processing, even though the base executor continues through its regular execution lifecycle.

Attack Path

  1. A user or automated validation process invokes `node in ...[truncated 1249 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make dry-run behavior an enforced executor-level property rather than an informal option.
  2. Return a planned-operation result before calling any state-changing lifecycle method, or pass a read-only execution context through every lifecycle stage.
  3. Prevent StateManager.update(), save(), and logError() from writing when dry-run mode is active.
  4. Ensure derived classes cannot accidentally bypass dry-run protections. Centralize side-effect authorization in the base class or use explicit write adapters that reject mutations in dry-run mode.
  5. If reporting a dry-run attempt is required, store it only in memory or require a separate explicit telemetry option; do not modify the normal state file.
  6. Add tests that record file hashes and modification times before and after dry-run execution and assert that no files change.
  7. Test derived executors to ensure filesystem, network, state, and external-process operations are suppressed during dry runs.
  8. If persistent state updates during dry-run are intentional, remove the “no side effects” claim and document the exact writes. A genuinely side-effect-free mode is preferable.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (24)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The report generator explicitly supports arbitrary command execution via exec({ command: section.command }) and also collects host data such as disk, memory, and uptime. In a reusable skill template, this normalizes command injection-prone patterns and system reconnaissance that could expose sensitive local information or be repurposed to run attacker-controlled commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Git hygiene example shows branch deletion and repository cleanup commands (git branch -d, reflog expiration, and git gc --prune) without warning about irreversible history and branch-loss consequences. As documentation for a reusable skill template, this is dangerous because it may encourage automated execution of destructive repository operations without review or backup.

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 · references/examples.md (reported line 318)May include surrounding context.

1. Prepare Metadata

Update SKILL.md frontmatter:

yaml
---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file provides copyable commands and a one-step batch script to perform a live external publication, including login, publish, and verification steps, but does not include any warning, confirmation checkpoint, dry-run guidance, or caution that execution causes an irreversible external release. In an agent-skill context, operational instructions like these can be surfaced or followed with minimal user scrutiny, increasing the risk of unintended publication, metadata leakage, or release of unreviewed content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes this skill as a demonstration/template for core architecture patterns, but this file presents full example implementations that perform real operational tasks: file-system watching, external API access, shell command execution, system metric collection, and file writes. Those behaviors go beyond merely showcasing entry logic and integration patterns and instead describe concrete automation capabilities.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The watcher example performs persistent filesystem monitoring and invokes shell-based backup commands using file paths derived from watched events. Even with quoted paths, this demonstrates unnecessary shell usage and continuous monitoring behavior that can capture or duplicate sensitive files in a way that is disproportionate for a core-architecture template.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example describes sending requests to external APIs and caching responses locally without any warning about data leaving the environment or being stored on disk. In a template context, omission of these privacy and data-handling caveats increases the chance that users will unintentionally transmit secrets or persist sensitive response data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The API example constructs a shell curl command from untrusted endpoint, method, headers, and data, creating a command injection surface in addition to outbound network transmission. Because it is presented as production-ready template code, users may adopt an unsafe pattern that can execute arbitrary shell fragments or exfiltrate data to remote endpoints.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/examples-advanced.md (reported line 495)May include surrounding context.

bash
# Fetch from API with automatic retry and rate limiting
node index.js --endpoint "https://api.github.com/repos/openclaw/openclaw" --method GET

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The report-generation example aggregates file contents, git data, command output, and system metrics into a written report without warning about sensitivity. This can consolidate secrets, internal repository data, and host telemetry into a single artifact that is easier to leak, share, or persist than the original scattered sources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file organizer example includes concrete mv commands that modify user files but provides no warning, confirmation step, backup guidance, or dry-run pattern. In a template/reference skill, this can normalize unsafe destructive workflows and lead downstream skill authors or users to run file-moving operations on unintended paths or globs.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes this skill as a demonstration/template for core architecture patterns, but this example extension adds a file-processing capability that discovers files via shell find and rewrites file contents. Those operational capabilities are not necessary to demonstrate architecture structure and introduce a materially broader capability than the stated purpose justifies.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file documents example skill patterns that read files and then overwrite them in place, and later introduces a logging plugin that appends data to a log file. The document does not include any user-facing warning that these examples modify files on disk or may persist execution data, which is relevant for a markdown file under the missing user warnings rule.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The execWithValidation wrapper is a reusable interface for executing arbitrary commands, which is a powerful capability not inherently required by a skill whose purpose is to showcase architecture and production-ready patterns. In a template/reference file, documenting this as a standard extension point normalizes command execution beyond the manifest's narrow demonstration scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The plugin logs arbitrary options, result, and error data to a persistent local file without any caution about sensitive-data retention. In a reusable architecture template, this encourages downstream skills to persist secrets, tokens, file contents, or stack traces to disk, increasing exposure through local compromise, overcollection, and accidental disclosure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The logging plugin writes data by constructing a shell command with interpolated content: echo ${JSON.stringify(logEntry)} >> ${this.logFile}. If logFile or logged data contains shell metacharacters, this pattern can lead to command injection or unintended shell behavior, and it normalizes unsafe logging through the shell in a reusable plugin example.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes this skill as a demonstration/template for core architecture patterns, but this document explicitly promotes using exec with shell commands such as cat file*.txt and inline node -e for routine file processing. Teaching subprocess/shell execution as an optimization pattern is not obviously justified by a generic architecture-template skill and expands capability into command execution without clear need from the stated purpose.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/examples-advanced.md (reported line 832)May include surrounding context.

md
error: 'Network timeout while fetching data',
  recovery: 'Retry with --timeout 60 flag or check network connection',
  details: {
    attemptedUrl: 'https://api.example.com/data',
    timeout: 30000
  }
};

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/examples-advanced.md (reported line 833)May include surrounding context.

md
error: 'Network timeout while fetching data',
  recovery: 'Retry with --timeout 60 flag or check network connection',
  details: {
    attemptedUrl: 'https://api.example.com/data',
    timeout: 30000
  }
};

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/troubleshooting.md (reported line 323)May include surrounding context.

md
error: 'Network timeout while fetching data',
  recovery: 'Retry with --timeout 60 flag or check network connection',
  details: {
    attemptedUrl: 'https://api.example.com/data',
    timeout: 30000
  }
};

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% 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 · tests/INTEGRATION_TEST_REPORT.md (reported line 137)May include surrounding context.

Bash Script Issue:

text
/usr/bin/grep: /OpenClaw/workspace/skills/l76-core-arch/SKILL.md: No such file or directory
→ Script uses Unix path conversion which fails on Windows
→ Recommendation: Use PowerShell on Windows or fix path handling

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file demonstrates patterns that write files (write, edit) and execute shell commands (exec) in example code, but the surrounding documentation does not warn readers that these operations can modify the filesystem or run commands. For a template skill intended for reuse, an explicit note about these side effects would better disclose safety-relevant behavior to users and authors adopting the pattern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The handler branch is labeled and logged as providing a 'Content preview', yet it only prints the file path and does not read or display any file content. This is an active mismatch between the inline intent communicated to readers and the implemented behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The tool-selection table includes web_fetch for fetching web pages and browser for complex web interaction, which adds network and browser automation capability to a skill described as a core architecture demonstration/template. Those capabilities may exist in a broader ecosystem, but they are not justified by the manifest's narrowly framed template purpose in this file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.