Back to skill

Security audit

skelm

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent skelm workflow helper, but it needs review because one scaffold script can generate unsafe executable TypeScript and some agent permission scopes may be broader than users expect.

Review before installing if you will use agent workflows. Do not run the scaffold helper with descriptions from untrusted issues, web pages, or model output; inspect generated .pipeline.mts files before validate/run. Use Pi SDK filesystem or shell permissions only inside an OS sandbox, container, or otherwise bounded workspace, and avoid putting real secrets in .env values inherited by agents or MCP servers. Only install the systemd gateway if you want a persistent local service.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/new-pipeline.sh:23
Finding

Unescaped Pipeline Description Allows Generated TypeScript Code Injection

Content
View full analysis
"$OUTPUT_FILE" ``` The substituted value is placed directly inside executable TypeScript: ```ts export default pipeline({ id: '{{ID}}', description: '{{DESCRIPTION}}', input: z.object({ ``` The agent template contains the equivalent sink: ```ts export default pipeline({ id: '{{ID}}', description: '{{DESCRIPTION}}', input: z.object({ ``` ### Technical Analysis The script accepts the description as arbitrary text and inserts it into both: 1. A dynamically constructed `sed` replacement expression. 2. A single-quoted TypeScript string literal. The value is not escaped for either syntax. Characters such as single quotes, backslashes, replacement metacharacters, and newlines can alter or terminate the intended string. An attacker can supply a description that closes the `description` string and adds additional object properties containing immediately invoked JavaScript or TypeScript expressions. For example, the general payload structure can introduce an expression similar to: ```text ', injected: (() => { /* attacker-controlled code */ })(), trailing: ' ``` This can produce syntactically valid TypeScript where the injected expression executes while the generated workflow module is imported. Pipeline execution is not necessarily required: any operation that imports the module may trigger top-level evaluation. This is an injection vulnerability rather than intentional malicious code in the shipped templates. ### Attack Path 1. An attacker cont ...[truncated 1293 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/agent-step.md:88
Finding

Recommended Pi SDK Configuration Does Not Enforce Filesystem Path Boundaries

Content
View full analysis
(ctx.steps.prepare as { prompt: string }).prompt, permissions: { // profile: 'my-profile', // optional: named profile from skelm.config.ts // Declare only what the agent actually needs; everything else stays denied. allowedTools: [], // e.g. ['gh.*'] or ['bash', 'rg'] allowedExecutables: [], // e.g. ['git', 'node'] allowedMcpServers: [], // ids from skelm.config.ts registries.mcpServers allowedSkills: [], // skill ids the agent may load fsRead: ['./'], // path roots agent may read fsWrite: [], // path roots agent may write networkEgress: 'deny', // ...[truncated 3014 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill states that .env and config.env are merged into process.env and then inherited by subprocesses, agent steps, and MCP servers. That design can expose secrets broadly to child processes and external integrations, increasing the risk of accidental secret leakage, prompt-driven exfiltration, or overbroad credential access if an agent or MCP server is compromised or misconfigured.

Content

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

md
### `.env` / `config.env` loading (v0.4.3)

The CLI merges `<projectRoot>/.env` and `config.env` into `process.env` at startup. Precedence: `process.env > .env > config.env`. Subprocess steps (`ctx.exec`, agents, MCP servers) inherit the merged env. Add `.env` to `.gitignore` for secrets; use `config.env` inside `skelm.config.mts` for non-secret defaults like model names and base URLs.

---

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

plugins?: readonly string[], // package names imported at gateway startup

// ── Environment variables (v0.4.3) ───────────────────────────────── env?: Record<string, string>, // static non-secret defaults; layered under .env })

text

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

plugins?: readonly string[], // package names imported at gateway startup

// ── Environment variables (v0.4.3) ───────────────────────────────── env?: Record<string, string>, // static non-secret defaults; layered under .env })

text

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 · scripts/new-pipeline.sh (reported line 14)May include surrounding context.

sh
#   --agent        use the agent-step template instead of the basic code-step template
#
# The script copies the template into the current directory and substitutes
# {{ID}} and {{DESCRIPTION}}. It does not overwrite existing files.

set -euo pipefail

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

The gateway owns permission resolution, enforcement, secret resolution, audit log, approval gating, trigger dispatch, and registry management.

Never write permission enforcement in pipeline or step code. Pipelines are the user layer. The gateway is the trust layer.

bash
skelm gateway start

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 · assets/skelm.config.template.ts (reported line 13)May include surrounding context.

ts
// llm:    'openai',
    // agent:  'pi',
    // openai: {
    //   baseUrl: 'https://api.openai.com/v1',  // or any OpenAI-compatible URL
    //   apiKey:  { secret: 'OPENAI_API_KEY' },
    //   model:   'gpt-4o-mini',
    // },

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/config.md (reported line 147)May include surrounding context.

md
// llm:    'openai',
    // agent:  'pi',
    // openai: {
    //   baseUrl: 'https://api.openai.com/v1',  // or any OpenAI-compatible URL
    //   apiKey:  { secret: 'OPENAI_API_KEY' },
    //   model:   'gpt-4o-mini',
    // },

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/config.md (reported line 222)May include surrounding context.

md
// llm:    'openai',
    // agent:  'pi',
    // openai: {
    //   baseUrl: 'https://api.openai.com/v1',  // or any OpenAI-compatible URL
    //   apiKey:  { secret: 'OPENAI_API_KEY' },
    //   model:   'gpt-4o-mini',
    // },

Session Persistence

Medium
Category
Rogue Agent
Confidence
83% confidence
Finding

The CLI documents persisted events being written to stderr, which can include workflow execution details that may contain prompts, tool outputs, identifiers, or sensitive operational data. Because these events are persisted and emitted through standard logging channels, they can be captured by terminals, CI systems, log aggregators, or shell redirection without users realizing the privacy impact.

Content

Scanner excerpt · references/cli.md (reported line 63)May include surrounding context.

--workflow Filter runs by workflow id --last Limit results (default: 20) --run Show one run in detail --events When used with --run, write persisted events to stderr --json Write history output as JSON

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The markdown documents skelm workspace clean <workflow-id> <name> --force, which strongly implies deletion or removal of workspace data, but it provides no warning about what will be deleted or whether the action is irreversible. For markdown files, safety-impacting behaviors that can affect user data should include an explicit warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation states that skelm gateway install --systemd writes a service file and uninstall --systemd removes it, but it does not include a user-facing warning about modifying local system configuration. In markdown, operations affecting system integrity or configuration should be disclosed clearly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Secrets management commands are exposed without any warning about sensitive output handling, shell history exposure, or plaintext process-argument leakage. In an agentic workflow system, operators may run secrets get or secrets set --value in environments where outputs are logged, persisted, or observable by other local users, leading to credential disclosure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation states that skelm validate has no runtime side effects, yet it also says validation imports the target pipeline. In Node/TypeScript, importing a module can execute top-level code, so a malicious or unsafe pipeline could perform file, network, or process actions during validation, violating operator expectations and creating a code-execution vector.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/gateway.md (reported line 16)May include surrounding context.

md
- **Registry management** — watches workflow, skill, and MCP server directories; hot-reloads on change.
- **ACP session persistence** — survives gateway restarts; sessions are re-attached on startup.

**Never write enforcement logic in pipeline or step code.** Pipelines are the user layer; the gateway is the trust layer.

## Starting the gateway

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/gateway.md (reported line 25)May include surrounding context.

skelm gateway status # pid, URL, state skelm gateway stop # SIGTERM a running gateway skelm gateway reload # SIGHUP — hot-reloads skelm.config.ts skelm gateway install --systemd # install ~/.config/systemd/user/skelm-gateway.service

text

`skelm gateway start` always runs in the foreground; pass `--detach` and the CLI will tell you to spawn it via systemd or a shell wrapper instead. For long-running deployments, install the systemd unit.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/gateway.md (reported line 28)May include surrounding context.

skelm gateway install --systemd # install ~/.config/systemd/user/skelm-gateway.service

text

`skelm gateway start` always runs in the foreground; pass `--detach` and the CLI will tell you to spawn it via systemd or a shell wrapper instead. For long-running deployments, install the systemd unit.

The gateway is required for:
- Agent steps (permission enforcement, backend lifecycle)

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/gateway.md (reported line 77)May include surrounding context.

bash
skelm gateway install --systemd    # writes ~/.config/systemd/user/skelm-gateway.service
systemctl --user enable skelm-gateway
systemctl --user start  skelm-gateway

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill documentation includes a command that installs a systemd unit under the user's home directory, which changes host system behavior persistently. While the command comment mentions the unit path, it does not explicitly warn the user that this installs a long-running service or advise reviewing the implications before running it.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.