T09 · Insecure Skill Coding Practices
- Location
references/tool-builder.md:235- Finding
Model-Controlled Tool Arguments Are Executed Through eval()
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is mostly SDK documentation, but it gives broad development command authority and includes copyable examples that could expose keys, upload files publicly, run unsafe code, or deploy open proxies.
Install only if you specifically want inference.sh JavaScript SDK guidance and are comfortable reviewing generated code carefully. Require approval before npm, npx, yarn, pnpm, or node commands; do not copy eval-based tool handlers; keep API keys server-only; add authentication, authorization, rate limits, and allowlists to proxy endpoints; avoid public file uploads unless intentional; and treat file uploads, webhooks, browser automation, and saved chat history as sensitive data-transfer or retention events.
references/tool-builder.md:235Model-Controlled Tool Arguments Are Executed Through eval()
SKILL.md:402Credential-Backed Inference Proxies Are Exposed Without Mandatory Access Control
references/server-proxy.md:389Public Browser Environment Variable Exposes the Inference API Key
references/files.md:5Automatic Upload and Public File Examples Can Disclose Sensitive Local Data
references/agent-patterns.md:153Conversation History Is Persisted in Plaintext and Replayed Without Integrity Validation
SKILL.md:14Executable SDK and Skill Dependencies Are Installed Without Version or Integrity Pinning
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
de', 'my-org/coder@latest') .describe('Write code to solve a problem') .param('task', string('Coding task description')) .param('language', string('Programming language')) .build();
### Webhook Tools
Tools that call external HTTP endpoints:
```typescript
import { webhookTool, string } from '@inferencesh/sdk';
// Slack notification
const slack = webhookTool('notify_slack', 'https://hooks.slack.com/services/...')
.describe('Send a message to Slack')
.param('channel', string('Channel name'))
.param('message', string('Message text'))
.build();
// Webhook with secret
const github = webhookTool('create_issue', 'https://api.github.com/repos/org/repo/issues')
.describe('Create a GitHub issue')
.secret('GITHUB_TOKEN') // Uses stored secret
.param('title', string('Issue title'))
.param('body', string('Issue description'))
.build();
| Method | Description |
|---|---|
.describe(text) | Set tool |
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
// Multi-turn conversation
const response2 = await agent.sendMessage('Tell me more');
// Reset conversation
agent.reset();
// Get chat history
Referenced artifact was not completely inspected
- [TypeScript](references/typescript.md) - Type definitions and type-safe patterns
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export async function POST(req: Request) {
const { data } = await req.json();
// Access secrets safely on server
const result = await fetch(process.env.EXTERNAL_API_URL, {
headers: { Authorization: `Bearer ${process.env.API_SECRET}` },
body: JSON.stringify(data)
The trigger list contains broad terms like npm install, node.js api, react ai, and frontend sdk, which are likely to match many ordinary development requests unrelated to this specific skill. Over-broad activation increases the chance that the skill is injected into unrelated contexts, expanding attack surface and causing unintended tool availability or instruction influence.
The skill recommends running npx skills add ... without pinning an exact package version or commit. npx resolves and executes the latest matching package at runtime, which creates a supply-chain risk if the upstream package is compromised or changes unexpectedly.
This example invokes npx skills without a pinned version, allowing execution of whatever package version is current at install time. That exposes users to package hijacking, malicious updates, or non-reproducible behavior in environments that trust the documentation.
Using npx skills without version pinning creates a classic documentation-driven supply-chain exposure because readers may execute an unreviewed latest release. In a skill file that explicitly allows Bash execution of npm/npx commands, this is more operationally dangerous because an agent could directly run the example.
This unpinned npx skills reference can lead users or agents to execute an unexpectedly changed or malicious package version. The risk is amplified by the skill’s permitted Bash tooling, which lowers the barrier from documentation to execution.
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.
Maintain context across sessions:
import { inference } from '@inferencesh/sdk';
This markdown file includes example code that saves and reloads full chat history to a local file via writeFileSync and readFileSync, but the surrounding documentation does not warn that user conversation data will be persisted on disk. Because markdown files should disclose behaviors affecting user data or privacy, this omission is a relevant safety concern.
The documentation demonstrates automatic uploads of local paths and an option for public: true without any caution about sensitive file disclosure, accidental exfiltration, or public accessibility. In an SDK file-handling guide, this can lead developers to copy insecure patterns directly into production workflows, especially because local path auto-upload obscures the security boundary between local files and remote service submission.
The chat and image analysis examples transmit user prompts and image URIs to a remote AI service without warning users that their content will be shared off-device/off-app. Because this is SDK documentation for frontend React apps, developers may embed these patterns unchanged, creating silent data disclosure of potentially sensitive text or media references.
The file upload component example sends a user-selected file to a remote service via client.uploadFile(file) but does not include any explicit UX warning, consent step, or disclosure that the file leaves the user's device. In a React integration reference, developers often copy examples directly, so this omission can lead to unintended transmission of sensitive files and privacy/compliance issues in downstream apps.
The document correctly advises never exposing API keys in browser code, but later includes a development example that uses NEXT_PUBLIC_INFERENCE_API_KEY in client-side configuration. This contradiction can lead developers to treat secret-bearing client configuration as acceptable, resulting in API key exposure, unauthorized use, and billing abuse.
The early example emphasizes 'Frontend code - no API key!' but a later example demonstrates initializing the frontend SDK with a NEXT_PUBLIC_ API key. In security-sensitive documentation, inconsistent guidance is dangerous because readers often copy the shortest working example, normalizing exposure of credentials in browser-delivered code.
The local testing example shows direct use of process.env.NEXT_PUBLIC_INFERENCE_API_KEY in code intended for frontend execution. In frameworks like Next.js, NEXT_PUBLIC_* variables are embedded into browser bundles, so this teaches a pattern that leaks the key to any user, enabling theft, replay, and uncontrolled consumption of the API account.
This markdown file includes a browser-automation workflow that opens a URL, clicks elements, types an email address, and captures a screenshot, but it does not warn that the skill may send user inputs to third-party websites or perform actions on their behalf. For markdown files, behaviors that can affect user data, privacy, or system integrity should be accompanied by an explicit warning.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
.build();
// Webhook with secret
const github = webhookTool('create_issue', 'https://api.github.com/repos/org/repo/issues')
.describe('Create a GitHub issue')
.secret('GITHUB_TOKEN') // Uses stored secret
.param('title', string('Issue title'))
The documentation shows eval(call.args.expression) in a tool handler, where call.args is model-influenced input. This normalizes arbitrary code execution as a calculator pattern, allowing an attacker or prompt-injected model output to execute JavaScript in the host process rather than merely evaluate math.
The complete example repeats eval in production-style sample code and frames it as an acceptable implementation for a calculator tool. Because tool arguments may be attacker-controlled or influenced by an LLM, this can lead to arbitrary JavaScript execution, data access, and system compromise in applications that copy the example.
The example sets public: true for file uploads without any warning that uploaded content may become publicly accessible. In SDK reference documentation, readers often copy examples verbatim, so this can lead to unintentional exposure of sensitive files, tokens, internal documents, or user data.
The download examples fetch remote content and write it to disk or trigger browser downloads without noting that the content is untrusted and may overwrite local files or deliver unsafe files to users. While the snippets are simple, documentation that omits trust and path-safety guidance can normalize unsafe handling of remote outputs.
The Stateful Conversations section demonstrates retaining chat context for 30 minutes, but it does not disclose that user-provided conversation content remains available within the session during that period. In markdown guidance, persistence of user data across requests should be called out when it could affect privacy expectations.
This markdown reference introduces webhook tools that send messages and issue content to external services such as Slack and GitHub, including use of a stored secret, but the surrounding documentation does not explicitly warn that tool inputs will be transmitted to third-party endpoints. Because this is a documentation file, SQP-2 applies when descriptions omit privacy or data-transfer warnings for behaviors that could affect user data.
Detected: suspicious.exposed_secret_literal