Back to skill

Security audit

CHECK

Security checks for vulnerabilities and agentic risk

Overview

This skill bundle is disclosed as a development helper, but it gives agents broad host command execution, package installation, code execution, file mutation, and automatic privilege attempts without clear safety gates.

Install only in a disposable or tightly sandboxed development environment, not on a machine with sensitive files, credentials, Docker access, passwordless sudo, or shared Python environments. Treat any command, package install, generated code run, test run, or file delete as equivalent to giving the skill local execution authority.

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 (6)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
universal_permission_manager_skill.py:116
Finding
Arbitrary Command Execution with Automatic Privilege Escalation<![CDATA[ ## Vulnerability Details **File Location**: `universal_permission_manager_skill.py`, lines 116-146, 158-160, 222-248, and 391-411 **Vulnerability Type**: Arbitrary OS command execution with automatic `sudo` fallback **Risk Level**: High ### Vulnerable Code ```python def run_command_with_fallback(self, command_str: str) -> Dict[str, Any]: try: parsed_command = shlex.split(command_str) result = self._try_run_command(parsed_command) if result["status"] == "success": return result strategies = [ lambda cmd: self._try_run_with_user_flag(cmd), lambda cmd: self._try_run_with_sudo(cmd), lambda cmd: self._try_run_with_verb_runas(cmd) ] for strategy in strategies: result = strategy(parsed_command) if result["status"] == "success": return result return result ``` ```python def _try_run_command(self, command: List[str]) -> Dict[str, Any]: try: result = subprocess.run( command, capture_output=True, text=True, timeout=60 ) ``` ```python def _try_run_with_sudo(self, command: List[str]) -> Dict[str, Any]: if self.system == "Windows": return { "status": "error", "error": "sudo不适用于Windows系统", "command": " ".join(command), "strategy_used": "sudo_not_applicable" } try: new_command = ["sudo"] + command result = subprocess.run( new_command, capture_output=True, text=True, timeout=60 ) ``` ```python elif "运行命令" in query_lower or "执行命令" in query_lower: import re cmd_match = re.search( r'(?:运行命令|执行命令|run|execute)\s+(.+)', query, re.IGNORECASE ) if cmd_match: command = cmd_match.group(1) return manager.run_any_command_safely(command) else: if query.strip( ...[truncated 2089 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the default behavior that executes every non-empty query. 2. Replace generic command execution with narrowly scoped, per-operation APIs. 3. Maintain an explicit allowlist of permitted executable paths, subcommands, and arguments. 4. Reject shell interpreters, privilege tools, package managers, destructive utilities, redirections, arbitrary script paths, and unapproved network clients. 5. Never retry attacker-controlled commands using `sudo`. 6. Require explicit, operation-specific user confirmation before any state-changing command. 7. Run approved commands as a dedicated unprivileged account inside a sandbox or container. 8. Apply filesystem, network, process, syscall, and resource restrictions. 9. Use absolute paths to trusted executables and a controlled environment with a restricted `PATH`. 10. Record security audit logs without exposing secrets or complete sensitive command output. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
permission_manager_skill.py:187
Finding
Shell Injection and Elevated Arbitrary Command Execution<![CDATA[ ## Vulnerability Details **File Location**: `permission_manager_skill.py`, lines 187-253 and 585-588 **Vulnerability Type**: Shell command injection and unsafe privilege escalation **Risk Level**: High ### Vulnerable Code ```python def run_with_elevated_privileges(self, command: str) -> Dict[str, Any]: try: if self.system == "Windows": return self._run_command_windows(command) else: return self._run_command_linux(command) except Exception as e: return { "status": "error", "error": str(e), "timestamp": datetime.now().isoformat() } ``` ```python def _run_command_windows(self, command: str) -> Dict[str, Any]: try: if self._check_admin_privileges(): result = subprocess.run( command, shell=True, capture_output=True, text=True, timeout=60 ) return { "status": "success", "command": command, "return_code": result.returncode, "stdout": result.stdout, "stderr": result.stderr } ``` ```python def _run_command_linux(self, command: str) -> Dict[str, Any]: try: if self._check_wsl_environment(): result = subprocess.run( command, shell=True, capture_output=True, text=True, timeout=60 ) return { "status": "success", "command": command, "return_code": result.returncode, "stdout": result.stdout, "stderr": result.stderr } else: result = subprocess.run( ['sudo'] + command.split(), capture_output=True, text=True, timeout=60 ) ``` ```python cmd_m ...[truncated 2190 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove every use of `shell=True` with user-controlled input. 2. Replace the generic `run_with_elevated_privileges()` interface with narrowly defined operations. 3. Parse requests into fixed command templates rather than accepting raw command strings. 4. Allow only reviewed executable paths, subcommands, flags, and operand formats. 5. Remove automatic `sudo` invocation and require a separate, explicit authorization workflow. 6. Reject metacharacters, but do not rely on character filtering as the primary defense. 7. Execute permitted diagnostics as a dedicated unprivileged user. 8. Use sandboxing and restrict filesystem, environment, network, and process access. 9. Base returned status on the actual child return code. 10. Add security tests covering command separators, substitutions, pipelines, traversal operands, and privilege-tool invocation. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
code_generator_tester_skill.py:29
Finding
Unsandboxed Execution of Generated and Caller-Provided Code<![CDATA[ ## Vulnerability Details **File Location**: `code_generator_tester_skill.py`, lines 29-50, 96-125, and 139-169 **Vulnerability Type**: Untrusted code execution without isolation **Risk Level**: High ### Vulnerable Code ```python def generate_and_run_code( self, language: str, requirements: str, test_code: Optional[str] = None ) -> Dict[str, Any]: try: generated_code = self.generate_code(language, requirements) with tempfile.NamedTemporaryFile( mode='w+', suffix=f'.{self.get_file_extension(language)}', delete=False ) as temp_file: temp_file.write(generated_code) temp_file_path = temp_file.name run_result = self.run_code(temp_file_path, language) test_result = None if test_code: test_result = self.run_tests( temp_file_path, test_code, language ) ``` ```python def run_code(self, file_path: str, language: str) -> Dict[str, Any]: try: if language.lower() == "python": result = subprocess.run( [sys.executable, file_path], capture_output=True, text=True, timeout=30 ) elif language.lower() == "javascript": result = subprocess.run( ["node", file_path], capture_output=True, text=True, timeout=30 ) elif language.lower() == "bash" or language.lower() == "shell": result = subprocess.run( ["bash", file_path], capture_output=True, text=True, timeout=30 ) ``` ```python def run_tests( self, main_file: str, test_code: str, language: str ) -> Dict[str, Any]: try: test_file_ext = self.get_file_extension(language) with tempfile.NamedTemporaryFile( ...[truncated 2804 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Never execute generated or caller-provided code directly on the host. 2. Use a disposable container or virtual machine for every execution. 3. Run as a non-root user with no sudo capability. 4. Disable network access unless explicitly required and approved. 5. Mount only a disposable working directory; do not mount the user home directory or project secrets. 6. Use a minimal environment and remove API keys, tokens, proxy credentials, and cloud metadata access. 7. Apply CPU, memory, process-count, file-size, and execution-time limits. 8. Apply syscall restrictions and prevent namespace escape or access to host sockets. 9. Destroy the sandbox and securely remove temporary files after every run. 10. Treat generated output as untrusted even when it originated from an approved model. ]]>

T08 · Insecure Dependencies

Warning
Location
environment_checker_skill.py:250
Finding
Unrestricted Third-Party Python Package Installation<![CDATA[ ## Vulnerability Details **File Location**: `environment_checker_skill.py`, lines 250-279 and 313-322; `CHECK002.py`, lines 316-333 and 395-412 **Vulnerability Type**: Unsafe dependency installation and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```python for pkg in packages_to_install: try: print(f"正在安装 {pkg}...") result = subprocess.run( [sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True, timeout=300 ) ``` ```python elif "install" in query.lower(): import re packages = re.findall( r'install ([a-zA-Z0-9_-]+)', query, re.IGNORECASE ) if packages: return checker.install_missing_packages(packages) ``` The duplicate installation workflow in `CHECK002.py` contains the same unsafe operation: ```python def install_python_packages(self, packages: List[str]) -> List[str]: results = [] for pkg in packages: try: print(f"正在安装 {pkg}...") result = subprocess.run( [sys.executable, "-m", "pip", "install", pkg], capture_output=True, text=True, timeout=300 ) ``` ```python def auto_install_missing_packages(self) -> List[str]: self.run_checks() packages_to_install = [] for recommendation in self.all_recs: if recommendation.startswith( "安裝 Python 套件: pip install " ): pkg = recommendation.replace( "安裝 Python 套件: pip install ", "" ).strip() packages_to_install.append(pkg) return self.install_python_packages(packages_to_install) ``` ### Technical Analysis The Skill installs package names from user requests and automatically generated recommendations through pip. It does not restrict packages to an approved inventory, pin versions, verify hashes, validate package provenanc ...[truncated 1616 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove arbitrary package installation from natural-language input. 2. Permit installation only from a reviewed dependency manifest. 3. Pin exact package versions and verify cryptographic hashes. 4. Use a private or explicitly configured trusted package index. 5. Disable unexpected extra indexes and dependency links. 6. Require explicit confirmation displaying the exact package, version, source, and transitive changes. 7. Install into an isolated virtual environment or disposable container, never into the Agent's shared interpreter. 8. Run dependency scanning and provenance checks before installation. 9. Prefer prebuilt, reviewed artifacts and reject untrusted source builds. 10. Separate environment inspection from environment mutation so a check cannot silently trigger installation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
code_generator_tester_skill.py:190
Finding
Unrestricted Filesystem Write and Overwrite Capability<![CDATA[ ## Vulnerability Details **File Location**: `code_generator_tester_skill.py`, lines 190-214 **Vulnerability Type**: Arbitrary file write outside the project workspace **Risk Level**: Medium ### Vulnerable Code ```python def save_code_to_project( self, code: str, file_path: str, language: str ) -> Dict[str, Any]: try: path_obj = Path(file_path) path_obj.parent.mkdir(parents=True, exist_ok=True) with open(file_path, 'w', encoding='utf-8') as f: f.write(code) if path_obj.exists(): return { "status": "success", "message": f"代码已保存到 {file_path}", "file_size": path_obj.stat().st_size, "timestamp": datetime.now().isoformat() } ``` ### Technical Analysis The method accepts an unrestricted file path, recursively creates parent directories, and opens the target in write mode. It does not verify that the resolved path remains under an approved project root. Absolute paths and relative traversal paths can therefore target any location writable by the Agent. The code also does not protect against symbolic-link traversal or prevent overwriting existing files. The unused `language` parameter provides no extension or content restriction. Even if the current natural-language route does not directly provide code content to this method, the method is a public capability in the Skill implementation and is unsafe for callers that supply untrusted paths. ### Attack Path 1. An attacker or untrusted caller supplies source content and a path outside the intended project directory. 2. `Path(file_path)` accepts the absolute or traversing path. 3. `mkdir(parents=True)` creates missing parent directories where permitted. 4. `open(..., 'w')` creates or truncates the target. 5. Attacker-controlled content replaces the original file. 6. If the file is later loaded or executed, the write can lead to additional code execution. ...[truncated 456 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Define a fixed, approved project root for all generated files. 2. Resolve both the root and candidate path and verify that the candidate is a descendant of the root. 3. Reject absolute paths and traversal components from untrusted input. 4. Reject symbolic links in every path component or use operating-system APIs that prevent symlink following. 5. Do not overwrite existing files without a separate confirmation and authorization decision. 6. Use exclusive creation where appropriate and atomic replacement for approved updates. 7. Restrict file extensions and enforce maximum content size. 8. Run file-writing operations under a minimally privileged account. 9. Log approved writes without recording sensitive file content. 10. Add tests for absolute paths, `..` traversal, symlink escapes, and overwrite attempts. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
environment_report.json:12
Finding
Committed Environment Report Discloses Host Identity and Filesystem Layout<![CDATA[ ## Vulnerability Details **File Location**: `environment_report.json`, lines 12-15 **Vulnerability Type**: Sensitive host metadata exposure **Risk Level**: Low ### Vulnerable Code or Data ```json "pip": { "installed": true, "version": "pip 25.3 from C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.13_3.13.3312.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\pip (python 3.13)", "path": "C:\\Users\\tilannlou\\AppData\\Local\\Microsoft\\WindowsApps\\pip.exe" } ``` ### Technical Analysis A generated environment report is included in the project artifact. It exposes a local username, absolute filesystem paths, operating-system layout, Python distribution details, and installed-tool information. No API-key values were observed in the report; the RAG checks only record whether named variables are configured. Nevertheless, committed diagnostic artifacts provide unnecessary host reconnaissance and personal metadata. ### Attack Path 1. The project bundle or repository is distributed to another party. 2. The recipient opens `environment_report.json`. 3. The report reveals the originating username and local software layout. 4. The information can be combined with other disclosures for targeted social engineering or host-specific attack planning. ### Impact Assessment The direct impact is limited to information disclosure, but the exposed data can reveal: - A personal or account identifier. - Operating-system and installation structure. - Python and pip versions. - Tool availability and local executable paths. - Additional environmental assumptions useful for reconnaissance. The report does not, based on the inspected content, expose actual API-key values. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove generated environment reports from distributable artifacts and source control. 2. Add diagnostic-output filenames to ignore rules. 3. Redact usernames, home directories, and absolute executable paths. 4. Record only the minimum version and availability information needed for diagnostics. 5. Review repository history if the report was previously published. 6. Add an automated release check that rejects reports, logs, environment files, credentials, and machine-specific paths. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (107)

Vague Triggers

High
Confidence
98% confidence
Finding
The generic `运行命令` / `run command` examples effectively position the skill as a broad arbitrary-command execution interface. In combination with the stated ability to attempt elevated execution, this creates a substantial risk of unintended or unsafe command execution, including destructive or privileged operations triggered by natural-language requests.

Missing User Warnings

High
Confidence
96% confidence
Finding
Running generated code and user-provided tests is equivalent to executing arbitrary code on the host, yet the README does not provide a strong warning or containment guidance. In an agent workflow, generated or supplied code may be attacker-influenced, making this a high-risk capability if not sandboxed and explicitly consented to.

Missing User Warnings

High
Confidence
98% confidence
Finding
Advertising attempts to use elevated permissions and to run any system command without a clear warning normalizes high-impact behavior that can alter the host significantly. In context, this is especially dangerous because the same skill bundle couples broad triggers with command execution and retry strategies, increasing the chance of unsafe privilege-affecting actions.

Vague Triggers

High
Confidence
97% confidence
Finding
These examples effectively advertise natural-language activation for arbitrary system-command execution. Since the same README states the skill can run commands and try multiple execution strategies, ambiguous activation substantially raises the likelihood of unintended or attacker-influenced command execution.

Vague Triggers

High
Confidence
98% confidence
Finding
The README explicitly maps everyday phrases such as package installs, git, docker, npm, and python commands to direct execution, which is effectively arbitrary command execution via broad natural-language triggers. In an agent setting, this creates a serious prompt-to-action gap where conversational text can cause system operations without a robust intent-verification step.

Missing User Warnings

High
Confidence
99% confidence
Finding
The skill explicitly claims it can 'intelligently run any system command' and automatically try multiple permission strategies, including privilege-related ones, without describing strong safety gates, allowlisting, confirmation, or risk warnings. In practice this creates a high-risk arbitrary command execution capability that could be used to run destructive commands, alter system state, access sensitive data, or normalize privilege escalation behavior.

Vague Triggers

High
Confidence
97% confidence
Finding
The skill advertises generic trigger phrases like raw commands (`pip install requests`, `docker ps`, `python script.py`) and `运行命令 ...`, which are broad enough to match ordinary user requests and silently route them into a privileged command-execution workflow. In the context of a skill that can run arbitrary system commands and try escalation strategies, overly broad activation materially increases the chance of unintended command execution and misuse.

Missing User Warnings

High
Confidence
99% confidence
Finding
The skill silently writes generated code to disk and executes it immediately, without warning the user or requiring approval. This is dangerous because it turns prompt-controlled content into local code execution with no safety checkpoint, making accidental or malicious harmful actions far more likely.

Context-Inappropriate Capability

High
Confidence
100% confidence
Finding
The skill's core behavior is to execute generated or user-supplied code locally through Python, Node, and Bash. In the context of an agent skill with no declared trust boundary or sandbox, this is a dangerous capability that enables arbitrary code execution and greatly expands the blast radius of prompt injection or malicious user input.

Missing User Warnings

High
Confidence
99% confidence
Finding
The skill writes user-provided test code to a file and runs it without any user-facing warning or confirmation. That behavior removes an important trust boundary and makes exploitation trivial if a user or upstream prompt injects malicious test content.

Intent-Code Divergence

High
Confidence
95% confidence
Finding
The skill presents itself as an environment checker, but it also performs package installation and can write results to a file. This mismatch increases the chance that users or orchestrators will invoke it expecting read-only diagnostics, when it can actually mutate the system and pull/install third-party code.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
Including package installation in a skill whose stated purpose is environment checking expands the trust boundary from inspection to code acquisition and execution. Installing Python packages can execute arbitrary setup/build steps and alter the runtime, making this significantly more dangerous than a diagnostic-only tool.

Missing User Warnings

High
Confidence
96% confidence
Finding
The RAG manager is granted read, write, and delete file permissions and is described as dynamically creating and organizing categories, yet the manifest gives no warning that user data may be modified or deleted. In this context, silent deletion or restructuring of knowledge assets could cause data loss, integrity issues, or unintended destruction if invoked through ambiguous prompts or by a higher-level agent.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
The skill claims to manage permissions but includes a generic elevated command runner that is far broader than its stated purpose. In an agent ecosystem, this is especially dangerous because a seemingly narrow utility skill becomes an arbitrary privileged execution surface.

Missing User Warnings

High
Confidence
97% confidence
Finding
The elevated command runner lacks strong user-facing warnings, approvals, and scoping despite enabling arbitrary command execution with possible admin/root privileges. In practice, this creates a high risk of accidental or induced misuse because the dangerous operation is normalized as a routine skill feature.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 检查是否已经有管理员权限
            if self._check_admin_privileges():
                # 直接运行命令
                result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=60)
                return {
                    "status": "success",
                    "command": command,
Confidence
99% confidence
Finding
Passing untrusted input to `subprocess.run(..., shell=True)` is classic command injection, and here it occurs in a branch that may already have administrator privileges. The skill context makes this more dangerous because the feature is exposed as a normal user-facing capability inside a permission tool, making abuse and accidental invocation more likely.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 检查是否在WSL中
            if self._check_wsl_environment():
                # 在WSL中尝试运行命令
                result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=60)
                
                return {
                    "status": "success",
Confidence
99% confidence
Finding
This is also command injection via `shell=True`, allowing metacharacters, pipelines, redirection, and command chaining from untrusted input. Even when not root, the executed commands run with the skill's process privileges and can access local files, credentials, and services.

Missing User Warnings

High
Confidence
95% confidence
Finding
The Docker execution path permits destructive and high-impact operations such as `run`, `exec`, `rm`, `rmi`, `build`, `pull`, and `push` without warning or confirmation, and may run them with `sudo`. Given Docker's ability to affect the host system and workloads, this is a significant safety and security issue.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The advertised capabilities explicitly include running system commands, which broadens the attack surface and invites use of the skill as a general command executor. That mismatch between theme and capability makes abuse more likely, especially when users or higher-level agents select skills by description.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The fallback strategy explicitly includes privilege-escalation attempts via sudo and administrator execution paths even though the skill's role is ostensibly diagnostic permission management. Embedding escalation logic into an agent skill greatly increases abuse potential and can turn simple input handling into privileged code execution.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The skill presents itself as a permission manager but exposes a general-purpose command runner that accepts arbitrary commands and executes them on the host. That capability is far broader than the stated role, making misuse or prompt-injection-driven abuse much more likely and more dangerous in this context.

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill can execute arbitrary system commands and automatically try alternate execution strategies, including sudo, without any explicit user-facing warning or confirmation gate at execution time. In an agent workflow, that creates a high risk of silent destructive actions triggered by unsafe prompts or indirect input.

Missing User Warnings

High
Confidence
100% confidence
Finding
When the query does not match predefined help phrases, the skill defaults to executing the raw user input as a system command. This makes accidental or adversarial triggering trivial and removes any meaningful separation between normal conversation input and host command execution.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The overview advertises capabilities for automatic package installation, arbitrary code/test execution, file writing, and permission-elevated command execution without documenting safety gates, user confirmation, scope restrictions, or sandboxing. In an agent skill bundle, these behaviors can directly modify the host system or execute harmful commands if invoked from untrusted prompts, making the missing safeguards a real security issue rather than a documentation-only concern.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
Comments, CLI descriptions, status messages, and errors throughout the file are presented in Chinese only. This constitutes a language policy concern because the skill forces a specific language experience without opt-in, fallback, or documented locale limitation.

Static analysis

No suspicious patterns detected.