Back to skill

Security audit

Code Runner

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real code runner, but it executes supplied snippets on the host with unsafe invocation guidance and no enforced isolation.

Install or use this only in a disposable sandbox, container, or VM with no sensitive files, credentials, or network access unless you explicitly need them. Do not let it run code from untrusted users automatically, and avoid the documented echo interpolation pattern; feed code through a safe stdin mechanism such as a quoted heredoc or an argument-array API. Prefer pinned, local or container-local language tools over global installs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:72
Finding

Shell Injection Through the Recommended Standard-Input Invocation

Content
View full analysis
" | node scripts/run-code.cjs ``` ``` ### Technical Analysis The recommended command places potentially untrusted source code inside a double-quoted shell argument. Double quotes do not prevent shell evaluation of command substitutions, variable expansion, or backticks. For example, source text containing `$(command)` is evaluated by the caller's shell before `echo` sends data to the runner. Consequently, malicious shell syntax can execute outside `run-code.cjs`. This bypasses the runner's timeout, output handling, temporary-file cleanup, and language-selection logic. The documentation's assertion that this method avoids escaping issues is therefore unsafe. ### Attack Path 1. An attacker supplies a code snippet containing shell substitution syntax such as `$(malicious-command)`. 2. An AI Agent follows the documented invocation and interpolates the snippet into `echo ""`. 3. The Agent's shell evaluates the substitution before starting or feeding the code runner. 4. The substituted command executes directly with the Agent process's operating-system privileges. 5. Only the resulting text is passed to `run-code.cjs`, potentially concealing the prior shell-side execution. ### Impact Assessment Successful exploitation permits arbitrary command execution as the account running the Agent. The attacker can access any files, environment variables, credentials, network resources, and processes available to that account. Because execution occurs outside the runner, its timeout and cleanup behavior do not constrain the injected command. ]]>
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/run-code.cjs:134
Finding

Untrusted Code Executes Without Mandatory Isolation or Least-Privilege Controls

Content
View full analysis
{ const startTime = Date.now(); const child = exec(command, { timeout: timeout, maxBuffer: 10 * 1024 * 1024, // 10MB buffer encoding: 'utf8' }, (error, stdout, stderr) => { ``` ```js async function runCode(languageId, code, options = {}) { const lang = languageId.toLowerCase(); const config = languageConfig[lang]; if (!config) { const supported = Object.keys(languageConfig).join(', '); throw new Error(`Unsupported language: ${languageId}\n\nSupported languages: ${supported}`); } const timeout = options.timeout || DEFAULT_TIMEOUT; let tempFile = null; let outputFile = null; try { // Handle compiled languages if (config.compile) { const tmpDir = os.tmpdir(); // Special handling for Java if (lang === 'java') { const className = extractJavaClassName(code); tempFile = createTempFile(code, config.ext, className); const dir = path.dirname(tempFile); // Compile const compileCmd = config.compileCmd(tempFile, null, dir); await executeCommand(compileCmd, timeout); // Run const runCmd = config.runCmd(null, dir, className); const result = await executeCommand(runCmd, timeout); // Cleanup class file cleanupFiles(path.join(dir, `${className}.class`)); ...[truncated 2802 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run-code.cjs:111
Finding

Predictable Files in a Shared Temporary Directory Enable Symlink and Race Attacks

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/LANGUAGES.md:13
Finding

Documentation Recommends Unpinned Global Third-Party Installations

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
echo "<code>" | node scripts/run-code.cjs <languageId>

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and usage guidance are broad enough to trigger on many generic requests about testing or checking code behavior, which can cause over-invocation of a high-risk capability: arbitrary code execution. In this context, overly permissive matching is more dangerous than usual because the skill enables direct execution across many languages and the instructions include ready-to-use command lines for running untrusted code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This skill is explicitly designed to execute arbitrary user-supplied code across many languages by writing it to disk and invoking interpreters/compilers with child_process. In an agent skill context, the absence of any safety gate, sandboxing, or explicit warning means the skill can be used to run destructive host commands, access local files, make network calls, or abuse available credentials, so the risk is real rather than merely informational.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/run-code.cjs:140