skill-command-execution-v1
25 rules · Keryn Software Licence · rules 0.8.0 · all packs
How to read a rule
- Severity
- How bad the finding is if it is real:
errorfails a default gate,warningandinfodo not. - Confidence
- P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
- False-positive risk
- low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
- Edge
- The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
- Taxonomy chips
- References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.
keryn.skillexec.reverse-shell-bash-devtcp
Section titled “keryn.skillexec.reverse-shell-bash-devtcp”error generic agent-skills, shell
Skill or hook text contains a bash reverse shell (interactive shell redirected over /dev/tcp or /dev/udp). If the agent follows it, the host hands a remote operator a shell with the developer’s privileges. Remove the instruction and treat the skill source as compromised.
Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line. Review the skill’s origin and any scripts it ships, and rotate credentials available to the agent session if it already ran.
References: https://www.gnu.org/software/bash/manual/html_node/Redirections.html
keryn.skillexec.reverse-shell-netcat
Section titled “keryn.skillexec.reverse-shell-netcat”error generic agent-skills, shell
Skill or hook text runs netcat with an exec/shell option or through a mkfifo pipe, which is the classic reverse or bind shell. Following it gives a remote party command execution on the developer machine. Remove it.
Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line and audit the skill. Legitimate skills never need netcat to hand a shell to another host.
References: https://nmap.org/ncat/guide/ncat-usage.html
keryn.skillexec.reverse-shell-socat
Section titled “keryn.skillexec.reverse-shell-socat”error generic agent-skills, shell
Skill or hook text uses socat to connect a TCP/TLS socket to a command (EXEC: or SYSTEM:), which is a reverse shell. Following it gives a remote operator a shell as the developer. Remove it.
Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line and review the skill’s provenance.
References: http://www.dest-unreach.org/socat/doc/socat.html
keryn.skillexec.reverse-shell-python
Section titled “keryn.skillexec.reverse-shell-python”error generic agent-skills, shell
Skill or hook text contains a Python one-liner that opens a socket and wires it to a shell (dup2, pty.spawn or subprocess). That is a reverse shell, not tooling. Remove it.
Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line and review the skill and its scripts.
References: https://docs.python.org/3/library/pty.html
keryn.skillexec.reverse-shell-script-langs
Section titled “keryn.skillexec.reverse-shell-script-langs”error generic agent-skills, shell
Skill or hook text contains a Perl, Ruby or PHP one-liner that opens a socket and execs a shell. That is a reverse shell. Remove it.
Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line and review the skill and its scripts.
References: https://www.php.net/manual/en/function.fsockopen.php
keryn.skillexec.reverse-shell-powershell
Section titled “keryn.skillexec.reverse-shell-powershell”error generic agent-skills, shell
Skill or hook text builds a System.Net.Sockets.TCPClient in PowerShell, the usual way to write a reverse shell. Following it gives a remote operator a shell as the developer. Remove it.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-78 CWE-506 LLM06 LLM03 ASI05 ASI04
Fix: Delete the line and review the skill and its scripts; legitimate skills use Test-NetConnection or Invoke- WebRequest, not raw sockets.
References: https://learn.microsoft.com/dotnet/api/system.net.sockets.tcpclient
keryn.skillexec.download-chmod-run
Section titled “keryn.skillexec.download-chmod-run”error generic agent-skills, shell
Skill text downloads a file with curl or wget, marks it executable and runs it in one chain. This is a pipe- to-shell with a file in the middle and gets the same unreviewed code execution. Download, verify a pinned SHA-256, then run.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-494 CWE-829 CWE-78 LLM03 LLM06 ASI04 ASI05
Fix: Vendor the script into the skill, or verify a pinned checksum before chmod. Do not let a skill fetch and run remote binaries.
keryn.skillexec.download-to-temp-exec
Section titled “keryn.skillexec.download-to-temp-exec”error generic agent-skills, shell
Skill text downloads into a world-writable or temp location (/tmp, /dev/shm, $TMPDIR, %TEMP%) and executes the file in the same line. Temp paths are the usual drop zone for staged payloads. Download to a reviewed location and verify a checksum first.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: depends_on something relies on a component it does not verify; it crosses the supply-chain boundary (code, models or prompts pulled in from outside).
CWE-494 CWE-829 CWE-78 LLM03 LLM06 ASI04 ASI05
Fix: Remove the fetch-and-run. If a helper is needed, ship it inside the skill directory so it is reviewed with the skill.
keryn.skillexec.fetch-to-interpreter
Section titled “keryn.skillexec.fetch-to-interpreter”error generic agent-skills, shell
Skill text streams a download straight into a non-shell interpreter (python, node, perl, ruby, php, pwsh). The remote code runs unreviewed with the developer’s privileges. Download, pin a hash, review, then run.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: depends_on something relies on a component it does not verify; it crosses the supply-chain boundary (code, models or prompts pulled in from outside).
CWE-494 CWE-829 CWE-95 LLM03 LLM06 ASI04 ASI05
Fix: Replace with a vendored script or a pinned package. Never pipe network output to an interpreter from a skill.
keryn.skillexec.staging-host-exec
Section titled “keryn.skillexec.staging-host-exec”error generic agent-skills, shell
Skill text fetches from a paste, file-drop, release-asset or IPFS host and executes the result on the same line. These hosts serve anonymous, mutable content, which makes them common payload staging points. Vendor the code or pin it by checksum.
Confidence P1: dangerous in context. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-494 CWE-829 CWE-506 LLM03 LLM06 ASI04 ASI05
Fix: Remove the instruction. If a release asset is legitimately needed, pin its SHA-256 and verify it before running.
keryn.skillexec.encrypted-archive-exec
Section titled “keryn.skillexec.encrypted-archive-exec”error generic agent-skills, shell
Skill text extracts a password-protected archive and runs its contents in the same line. A password on the command line is a common way to hide a payload from scanners. Ship reviewable files instead.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-506 CWE-829 CWE-78 LLM03 LLM06 ASI04 ASI05
Fix: Remove the archive step. Skills should contain plain, reviewable scripts.
keryn.skillexec.decrypt-pipe-to-interpreter
Section titled “keryn.skillexec.decrypt-pipe-to-interpreter”error generic agent-skills, shell
Skill text decrypts data (openssl enc -d, gpg –decrypt) and pipes the plaintext into an interpreter. Encrypted code cannot be reviewed and is typically used to evade scanners. Do not execute decrypted content from a skill.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another.
CWE-506 CWE-78 LLM03 LLM06 ASI04 ASI05
Fix: Remove the decrypt-and-run step; keep code in the skill as plain text.
keryn.skillexec.powershell-encodedcommand
Section titled “keryn.skillexec.powershell-encodedcommand”error generic agent-skills, shell
Skill text starts PowerShell with -EncodedCommand, so the command is opaque base64 that a reviewer cannot read. Use a plain command or script file so the skill can be reviewed.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-78 CWE-116 LLM06 LLM03 ASI05
Fix: Replace with the readable command. Treat an encoded command in a skill as hostile unless you have decoded and checked it.
References: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_powershell_exe
keryn.skillexec.powershell-base64-iex
Section titled “keryn.skillexec.powershell-base64-iex”error generic agent-skills, shell
Skill text decodes base64 with [Convert]::FromBase64String and evaluates it with Invoke-Expression, hiding the executed code from review. Replace with a readable script.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-95 CWE-116 LLM06 LLM03 ASI05
Fix: Remove the decode-and-evaluate step and put the readable code in the skill.
References: https://learn.microsoft.com/dotnet/api/system.convert.frombase64string
keryn.skillexec.powershell-execution-policy-bypass
Section titled “keryn.skillexec.powershell-execution-policy-bypass”warning generic agent-skills, shell
Skill text runs PowerShell with -ExecutionPolicy Bypass (or Unrestricted), switching off the script-signing check for the commands that follow. A skill should not weaken the host’s policy; this is usually paired with downloaded scripts.
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Sign the script or run it under the existing policy. Do not instruct the agent to bypass execution policy.
References: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies
keryn.skillexec.macos-quarantine-bypass
Section titled “keryn.skillexec.macos-quarantine-bypass”error generic agent-skills, shell
Skill text strips the com.apple.quarantine attribute or disables Gatekeeper (spctl). That removes macOS’s check on downloaded software so an unsigned payload can run. Do not instruct the agent to bypass Gatekeeper.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
CWE-494 LLM06 LLM03 ASI05 ASI04
Fix: Remove the instruction. If an app is genuinely trusted, the user should approve it through System Settings.
References: https://ss64.com/mac/xattr.html · https://ss64.com/mac/spctl.html
keryn.skillexec.macos-sip-disable
Section titled “keryn.skillexec.macos-sip-disable”error generic agent-skills, shell
Skill text disables macOS System Integrity Protection (csrutil disable or authenticated-root disable). SIP protects system files from tampering even by root; no skill needs it off.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
Fix: Remove the instruction.
References: https://ss64.com/mac/csrutil.html
keryn.skillexec.linux-security-disable
Section titled “keryn.skillexec.linux-security-disable”error generic agent-skills, shell
Skill text turns off a Linux host control (SELinux enforcing, ufw/firewalld, AppArmor, firewall rules flush). Disabling these lets later payload traffic and actions through. Remove it.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
Fix: Remove the instruction. Open the specific port or policy that is needed instead of disabling the control.
References: https://man7.org/linux/man-pages/man8/setenforce.8.html
keryn.skillexec.windows-defender-disable
Section titled “keryn.skillexec.windows-defender-disable”error generic agent-skills, shell
Skill text adds Microsoft Defender exclusions, turns off real-time monitoring or switches off the Windows firewall. That blinds endpoint protection ahead of a payload. Remove it.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
Fix: Remove the instruction. Never exclude paths or disable protection from a skill.
References: https://learn.microsoft.com/powershell/module/defender/set-mppreference
keryn.skillexec.sudoers-nopasswd
Section titled “keryn.skillexec.sudoers-nopasswd”error generic agent-skills, shell
Skill text writes a passwordless sudo rule (NOPASSWD: ALL) into /etc/sudoers or sudoers.d. That gives the agent, and anything it runs later, root without a prompt. Remove it.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
CWE-269 CWE-250 LLM06 ASI03 ASI05
Fix: Remove the instruction. Grant narrowly scoped, reviewed sudo rules through your own configuration management.
References: https://www.sudo.ws/docs/man/sudoers.man/
keryn.skillexec.interpreter-oneliner-fetch-exec
Section titled “keryn.skillexec.interpreter-oneliner-fetch-exec”error generic agent-skills, shell
Skill text runs an interpreter one-liner (python -c, node -e, ruby -e) that fetches a URL and evaluates the result. It is a pipe-to-shell hidden inside a quoted program. Download and review code instead.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: depends_on something relies on a component it does not verify; it crosses the supply-chain boundary (code, models or prompts pulled in from outside).
CWE-95 CWE-494 LLM03 LLM06 ASI04 ASI05
Fix: Remove the one-liner. Vendor and review the code, or install a pinned package.
keryn.skillexec.base64-exec-script-langs
Section titled “keryn.skillexec.base64-exec-script-langs”error generic agent-skills, shell
Skill text evaluates base64-decoded content in Python, Node or another interpreter (exec(base64.b64decode(…)), eval(Buffer.from(…, ‘base64’)), base64 -d piped to python). Encoded code cannot be reviewed. Replace with plain code.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
CWE-95 CWE-116 LLM06 LLM03 ASI05
Fix: Remove the decode-and-evaluate step and keep readable code in the skill.
keryn.skillexec.go-rust-shell-network-spawn
Section titled “keryn.skillexec.go-rust-shell-network-spawn”warning generic agent-skills, shell
Skill text embeds Go or Rust code that spawns sh -c with a network tool (curl, wget, nc, /dev/tcp) in the command string. Compiled helper code is harder to review than a script and shell-wrapping network commands is a payload-delivery shape. Use an HTTP client library and review the program.
Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.
Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).
Fix: Replace the shell wrapper with a typed HTTP client and an argv-style call, and put the code in a reviewed file.
References: https://pkg.go.dev/os/exec · https://doc.rust-lang.org/std/process/struct.Command.html
keryn.skillexec.clipboard-exfil
Section titled “keryn.skillexec.clipboard-exfil”error generic agent-skills, shell
Skill text reads the clipboard (pbpaste, xclip, xsel, wl-paste, Get-Clipboard) and sends it over the network. Clipboards routinely hold passwords and tokens. Remove the instruction.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: sends data leaves for another party; it crosses the secret->outside boundary (a secret leaving the trusted side).
CWE-200 CWE-359 LLM02 LLM06 ASI02 ASI05
Fix: Remove the clipboard read-and-send. No skill needs to transmit clipboard contents.
References: https://ss64.com/mac/pbpaste.html
keryn.skillexec.download-then-sudo-run
Section titled “keryn.skillexec.download-then-sudo-run”error generic agent-skills, shell
Skill text downloads something and, in the same chain, runs it with sudo. Unreviewed remote code gets root. Download, verify a pinned checksum, review, and only then elevate.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: depends_on something relies on a component it does not verify; it crosses the supply-chain boundary (code, models or prompts pulled in from outside).
CWE-494 CWE-250 CWE-78 LLM03 LLM06 ASI04 ASI05 ASI03
Fix: Remove the chain. If root is needed, the user should run a reviewed installer themselves.