Back to skill

Security audit

Linux Ops

Security checks for vulnerabilities and agentic risk

Overview

This is a Linux command cheat sheet, but it includes powerful account, firewall, service, and passwordless sudo examples without guardrails, so it needs review before use.

Install only if you want a Chinese Linux operations reference and will treat its administrative examples as raw reminders, not safe defaults. Do not copy the passwordless sudo, user deletion, recursive chmod/chown, firewall, packet-capture, service-stop, or service-enable examples onto real systems without explicit authorization, target validation, backups or rollback plans, and least-privilege constraints.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/users.md:68
Finding
Unrestricted Passwordless Root Access Through Sudoers Configuration## Vulnerability Details **File Location**: `references/users.md`, line 68 **Vulnerability Type**: Unrestricted passwordless privilege escalation **Risk Level**: High **Vulnerable Code**: ```text username ALL=(ALL) NOPASSWD: ALL ``` ### Technical Analysis The documented sudoers rule grants `username` permission to execute every command as any user, including root, without authentication. This violates least-privilege principles and removes the password prompt that would otherwise provide an additional control against unauthorized privilege escalation. Although the Skill is a command-reference document and does not apply this configuration automatically, an agent or administrator following the guidance could introduce a persistent access-control weakness. The reference provides no command restrictions, authentication requirement, `visudo` validation guidance, explicit authorization requirement, or rollback procedure. ### Attack Path 1. An agent or administrator adds the documented rule to the system's sudoers configuration. 2. An attacker compromises the `username` account, obtains execution in its session, or exploits an application running under that account. 3. The attacker invokes an arbitrary command through `sudo`, such as starting a root shell. 4. Because the rule uses `NOPASSWD: ALL`, no password or additional authentication is required. 5. The attacker gains unrestricted root-level control of the host. ### Impact Assessment Successful exploitation grants complete administrative privileges on the affected system. An attacker could read or modify protected data, access credentials, alter security controls, create accounts, install persistent services or scheduled tasks, tamper with logs, and execute arbitrary commands as root. The impact applies to any host where this example is implemented. The package itself contains no script that automatically installs the rule.
Remediation
## Remediation Suggestions - Remove the unrestricted `NOPASSWD: ALL` example. - Grant only the minimum commands required for a defined operational role, using absolute executable paths and narrowly scoped arguments where feasible. - Retain password authentication unless a documented automation requirement makes passwordless execution unavoidable. - Place approved rules in a dedicated file under `/etc/sudoers.d/` with restrictive ownership and permissions. - Edit and validate sudoers rules using `visudo` or `visudo -cf` before deployment. - Require explicit user authorization before modifying sudo privileges. - Avoid granting access to interpreters, shells, editors, or commands that can escape into arbitrary command execution. - Document testing, auditing, expiration, and rollback procedures for every elevated permission.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (19)

Credential Access

High
Category
Privilege Escalation
Content
whoami                      # 当前用户
id                          # 用户信息
id username                 # 指定用户信息
cat /etc/passwd             # 所有用户

# 创建用户
useradd username
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The manifest description and introductory content are written in Chinese, while the skill name and headings suggest a generally applicable Linux operations reference. There is no indication that the skill is intentionally limited to Chinese-speaking users or that users can opt into another language, which creates a natural-language locale policy concern.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The cheat sheet includes `kill -9 PID` as a quick-reference command without any caution about when forceful termination is appropriate. In an operational skill, users may copy commands directly, and using SIGKILL indiscriminately can terminate critical processes abruptly, causing service interruption, data loss, or corruption because the process cannot clean up gracefully.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
Packet capture commands can collect sensitive network contents and metadata, while firewall commands modify host/network behavior; both categories carry privacy and operational risk. Presenting them without warnings, scope limitations, or least-privilege guidance increases the chance that an agent or user applies them broadly, captures unauthorized traffic, or unintentionally disrupts services.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill is described as a network diagnostic/troubleshooting reference, but it includes active firewall modification commands such as allowing ports, denying ports, and enabling the firewall. In an agent skill context, this expands from read-only diagnostics into state-changing system administration actions that can disrupt connectivity, alter host exposure, or lock out legitimate access if surfaced or used without clear authorization boundaries.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This markdown file includes commands that terminate processes (`kill -9`, `pkill`, `killall`) and stop/disable services (`systemctl stop`, `disable`) but provides no warning that these actions can interrupt running workloads or affect system availability. Under the markdown-specific warning rule, user-facing documentation should disclose potentially disruptive behavior when presenting such commands.

Session Persistence

Medium
Category
Rogue Agent
Content
killall nginx               # 按名称终止

# 后台运行
nohup python app.py &
nohup python app.py > output.log 2>&1 &
```
Confidence
65% 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.

Session Persistence

Medium
Category
Rogue Agent
Content
killall nginx               # 按名称终止

# 后台运行
nohup python app.py &
nohup python app.py > output.log 2>&1 &
```
Confidence
65% 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.

Session Persistence

Medium
Category
Rogue Agent
Content
systemctl stop nginx
systemctl restart nginx
systemctl reload nginx
systemctl enable nginx      # 开机启动
systemctl disable nginx

# 查看服务
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.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This markdown file presents all headings and command explanations in Chinese, which effectively forces a specific language for users of the skill. The policy allows locale-specific content only when users are given a choice or when the constraint is clearly documented and justified, neither of which appears here.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This section documents destructive account-management operations such as deleting users and homes without any warning, confirmation guidance, or scope constraints. In an agent skill, these commands can be copied or suggested directly into production environments, leading to accidental account removal, loss of user data, and service disruption.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This section describes permission, ACL, and sudo-related changes that can materially alter access control, including recursive ownership/permission changes and passwordless sudo. Without warnings about least privilege, target validation, and system-wide impact, an operator or agent could unintentionally overexpose files or grant excessive privileges.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
ls -la                      # 查看权限

# 修改权限
chmod 755 file
chmod +x file
chmod -R 755 directory/
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
setfacl -x u:user file
```

## sudo

```bash
# 添加到 sudo 组
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
## sudo

```bash
# 添加到 sudo 组
usermod -aG sudo username   # Debian/Ubuntu
usermod -aG wheel username  # CentOS/RHEL
Confidence
94% confidence
Finding
Adding a user to the `sudo` or `wheel` group grants broad administrative capability on many Linux systems. In this skill, the command is presented as a quick-reference action without warning or approval context, making accidental or unjustified privilege escalation more likely.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# 添加到 sudo 组
usermod -aG sudo username   # Debian/Ubuntu
usermod -aG wheel username  # CentOS/RHEL

# /etc/sudoers
Confidence
99% confidence
Finding
The example `username ALL=(ALL) NOPASSWD: ALL` grants unrestricted passwordless root-equivalent access, eliminating an important control and greatly increasing blast radius if the account is misused or compromised. In an operational cheat sheet, such an example is especially dangerous because it may be copied verbatim into `/etc/sudoers`.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The document title and all instructional content are presented in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
98% confidence
Finding
All headings and descriptions in the file are in Chinese, and the skill does not indicate that language selection is optional or that the content is intentionally limited to a Chinese-speaking context. Per the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The file presents all instructional content in Chinese and does not indicate that the language is optional, user-selectable, or justified by a region-specific constraint. Per the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Static analysis

No suspicious patterns detected.