Back to skill

Security audit

Oktk

Security checks for vulnerabilities and agentic risk

Overview

The skill has a plausible token-saving purpose, but its wrapper can re-run shell commands and persist command/output data locally by default.

Review this carefully before installing. Avoid sourcing the shell aliases or using the universal wrapper for commands that modify files, deploy services, install packages, delete resources, or touch Docker/Kubernetes state. Treat all filtered output as still potentially sensitive, and disable or clear ~/.oktk cache/analytics if you do not want command metadata or output retained locally.

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
scripts/oktk.js:132
Finding

Shell Injection and Duplicate Command Execution in the Command Wrapper

Content
View full analysis
&1 | oktk "git $*" } ``` `scripts/oktk-aliases.sh:42-52`: ```bash # Full docker wrapper function dk() { docker "$@" 2>&1 | oktk "docker $*" } dkc() { docker-compose "$@" 2>&1 | oktk "docker-compose $*" } ``` `scripts/oktk-aliases.sh:58-60`: ```bash # Full kubectl wrapper function kk() { kubectl "$@" 2>&1 | oktk "kubectl $*" } ``` `scripts/oktk-aliases.sh:85-87`: ```bash ok() { "$@" 2>&1 | oktk "$*" } ``` ### Technical Analysis The CLI converts structured process arguments back into a single command string using `args.join(' ')`. It then supplies that string to `child_process.execSync()`, which executes the command through a system shell. The shell wrappers compound the problem by converting their structured argument arrays into command text using `$*`. Quoting information and argument boundaries are lost during this conversion. Shell metacharacters that were originally contained inside a literal argument can therefore become active shell syntax when `oktk` executes the reconstructed string. Potentially dangerous syntax includes: - Command substitution: `$(...)` and backticks - Command separators: `;` and ...[truncated 2737 chars]
Remediation
View remediation
&1 | oktk "$*" ``` with a stdin mode that does not execute the supplied metadata: ```bash "$@" 2>&1 | oktk --stdin --type generic ``` 6. **Add regression tests** - Verify that literal arguments containing `;`, `&&`, `|`, `>`, `$()`, backticks, spaces, quotes, and newlines remain literal. - Verify that every wrapper executes its target exactly once. - Verify that stdin-filtering mode never invokes `child_process`. ]]>

T09 ยท Insecure Skill Coding Practices

Warning
Location
scripts/analytics.js:39
Finding

Default Local Persistence of Potentially Sensitive Command Metadata and Output

Content
View full analysis
0 ? (savings / originalLength * 100).toFixed(1) : 0; const entry = { timestamp, cacheKey, command: this.sanitizeCommand(command), original: originalLength, filtered: filteredLength, saved: savings, savedPercent: parseFloat(savingsPercent), filterName, method: 'filtered' // or 'cache' for cache hits }; // Append to log await this.appendLog(entry); // Update stats await this.updateStats(entry); } ``` `scripts/analytics.js:322-337`: ```javascript sanitizeCommand(command) { // Remove sensitive patterns let sanitized = command .replace(/api[_-]?key[=:]\s*[^\s]+/gi, 'api_key=***') .replace(/secret[=:]\s*[^\s]+/gi, 'secret=***') .replace(/token[=:]\s*[^\s]+/gi, 'token=***') .replace(/password[=:]\s*[^\s]+/gi, 'password=***') .replace(/bearer\s+[^\s]+/gi, 'bearer ***'); // ...[truncated 5400 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (38)

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
90% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt ยท IMPLEMENTATION.md (reported line 196)May include surrounding context.

md
# Basic usage
node scripts/oktk.js <command>

# Raw output (bypass filter)
node scripts/oktk.js <command> --raw

# Show savings

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims AI/LLM-based auto-learning and compression before sending to GPT-4/Claude, but the finding indicates heuristic local filtering plus persistent learned-pattern storage under ~/.oktk/learned. Misrepresenting learning and undisclosed persistence can mislead users into exposing sensitive command output under incorrect assumptions about what the tool does and stores.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
90% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt ยท SKILL.md (reported line 144)May include surrounding context.

See your total savings

oktk --stats

Bypass filter (get raw)

oktk --raw git status

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill advertises wrapping any command and summarizing network responses such as curl output, yet there is no warning that sensitive response bodies, headers, tokens, or credentials may be processed, cached, or logged. In context, this is more dangerous because network command output often contains API secrets, internal service data, or personal information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented persistent cache and config storage imply that command outputs or derived summaries may be written to disk, but users are not warned about that persistence. Since this tool processes outputs from arbitrary commands, disk caching may unintentionally retain secrets, proprietary data, or environment details beyond the immediate session.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The implementation documents persistent analytics, command logging, and memory/user-preference storage that exceed the stated purpose of merely compressing CLI output. In a tool that processes arbitrary command output, these features can collect and retain sensitive operational data such as command contents, paths, tokens, or infrastructure details without clear necessity or disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation describes command logging and auditable filter-operation logs without any user-facing notice about what command-related data is collected or persisted. Because the tool handles arbitrary shell outputs, undisclosed logging can capture secrets, repository names, hostnames, internal URLs, and other sensitive context that users may not expect to be retained.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The planned integrations with cron jobs, memory, and sub-agent-specific configurations expand the skill from a local output compressor into broader automation and persistence territory. That larger scope increases the chance of unattended processing, wider data exposure, and use in contexts users did not intend, especially when handling arbitrary command outputs.

Content

No source excerpt is available for this finding.

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 ยท IMPLEMENTATION.md (reported line 295)May include surrounding context.

md
- Research: `research/oktk-multi-model-review.md`
- Safety: `research/oktk-fallback-strategy.md`
- Skill Doc: `skills/oktk/SKILL.md`

---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly promotes sending command output to an LLM after compression, but it does not adequately warn users that terminal output can still contain secrets, internal paths, URLs, tokens, credentials, customer data, or proprietary code. Compression and summarization reduce size, not sensitivity, so users may be misled into thinking the tool makes such data safe to share with external AI services.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises shell-oriented behavior and the findings indicate code capabilities involving shell and environment access, yet the manifest declares no tool scope such as permissions or allowed-tools. That creates an authorization blind spot: consumers cannot easily tell what execution surface the skill needs, and a host may grant broader access than necessary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation says outputs are compressed before being sent to GPT-4/Claude, but it does not warn that CLI output may contain secrets, tokens, internal URLs, customer data, or infrastructure state. Users may assume summarization equals safety and inadvertently transmit sensitive material to external model providers.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

Instructing users to source an aliases script from shell startup files creates persistent command-wrapping behavior across future sessions. Persistent shell modification increases blast radius if the script is changed later, and users may forget that common commands are being transparently transformed or piped through extra logic.

Content

Scanner excerpt ยท SKILL.md (reported line 153)May include surrounding context.

Source the aliases file for automatic filtering:

bash
# Add to ~/.zshrc or ~/.bashrc
source ~/.openclaw/workspace/skills/oktk/scripts/oktk-aliases.sh

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This module enables persistent on-disk collection of command metadata and usage statistics, including sanitized command strings and cache keys, even though the skill is presented primarily as a token-compression utility. That creates an unnecessary data-retention surface: local command history may reveal repository names, infrastructure targets, usernames, paths, or partially redacted secrets, and the persistence is automatic unless explicitly disabled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code writes command-derived telemetry to local log and stats files without any visible consent, prompt, or notice in this component. Silent collection is risky because users may not realize operational metadata is being retained on disk, where other local users, backups, endpoint tools, or later compromise could expose it.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Keeping the last 100 sanitized commands in stats.json materially increases sensitive-context retention beyond what is needed to report aggregate token savings. Even with sanitization, commands can still expose hostnames, project names, branch names, Kubernetes resource names, file paths, and command intent, which may be sensitive in enterprise environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The reset method unlinks both the log and stats files, which is a destructive operation. The code has error logging but no confirmation prompt, advance warning, or explanatory notice to the user before deleting stored data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The header comment says the filter uses a cheap/local LLM to analyze unknown command output and extract essential information. However, the actual learning path at L109-L116 states AI-based learning was removed for security and simply returns a heuristic pattern generator, creating a direct contradiction between documentation and behavior.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.obfuscated_code

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/oktk.js:136

Potential obfuscated payload detected.

Warn
Code
suspicious.obfuscated_code
Location
test/test.js:110