Back to skill

Security audit

Cis Openeuler Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real OpenEuler CIS audit tool, but it needs review because its sudo collection script can expose sensitive system details and handles output files unsafely.

Install only if you are comfortable running a privileged host-audit script and protecting the generated baseline files. Use it only on systems you administer, write reports to a private root-owned directory, avoid shared or pre-existing output directories, and treat the raw baseline as sensitive security data.

Vulnerability Patterns
  • 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
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/collect-baseline.sh:7
Finding

Privileged Arbitrary File Overwrite Through Symlinked Output Files

Content
View full analysis
&2; } # ---- System information ---- info "Collecting system information..." { echo "=== System distribution ===" cat /etc/openEuler-release 2>/dev/null || cat /etc/os-release 2>/dev/null || echo "N/A" ``` The block is subsequently written using a predictable filename: ```bash } > "$OUTPUT_DIR/system-info.txt" ``` The same pattern is used for numerous other files throughout the script, including `packages.txt`, `fstab.txt`, `sudo.txt`, and `cron-jobs.txt`. ### Technical Analysis The script is explicitly intended to run with `sudo`, but it accepts an arbitrary output directory from the invoking user. `mkdir -p` permits that directory to exist already and does not validate its owner, permissions, or contents. Shell output redirection follows symbolic links by default. Consequently, if an attacker can pre-create the selected directory and place a symbolic link at one of the predictable output paths, the root shell running this script will open and truncate the symlink target. Quoting `$OUTPUT_DIR` prevents shell word splitting but does not protect against filesystem link attacks. The script does not use a restrictive creation policy, reject existing output directories, check for symbolic links, or open files with no-follow semantics. ### Attack Path 1. A local unprivileged attacker creates a directory that the attacker controls. 2. The attacker creates a symbolic link using one of the predictable report filenames, for example: ```bash mkdir -p /tmp/prepared-baseline ln -s /etc/target-file /tmp/prepared-baseline/system- ...[truncated 1499 chars]
Remediation
View remediation
&2 exit 1 fi ``` 3. If existing directories must be supported, verify that the directory is owned by the effective privileged user, is not writable by group or others, and is not a symbolic link. 4. Reject every output path that already exists, including symbolic links: ```bash output="$OUTPUT_DIR/system-info.txt" if [[ -e "$output" || -L "$output" ]]; then echo "Refusing an existing output path: $output" >&2 exit 1 fi ``` 5. Prefer secure file creation with exclusive and no-follow semantics. A small helper implemented in a language exposing `O_CREAT | O_EXCL | O_NOFOLLOW`, or a securely created private temporary directory, is safer than ordinary shell redirection. 6. Canonicalize and constrain caller-supplied destinations where operationally possible. For automated execution, use a fixed root-owned report directory that unprivileged users cannot modify. 7. Add regression tests that create symlinks for every predictable report filename and confirm the script refuses to run without altering the link target. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/collect-baseline.sh:7
Finding

Privileged Audit Snapshots May Be Created with World-Readable Permissions

Content
View full analysis
/dev/null || echo "N/A" echo echo "=== audit rules ===" auditctl -l 2>/dev/null || echo "N/A" echo echo "=== audit.rules file ===" cat /etc/audit/rules.d/*.rules 2>/dev/null || echo "N/A" } > "$OUTPUT_DIR/auditd.txt" ``` It also includes password-account metadata: ```bash echo "=== shadow (users only) ===" awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A" ``` Sudo policy is copied into the snapshot: ```bash { echo "=== sudoers ===" cat /etc/sudoers 2>/dev/null || echo "N/A" echo echo "=== sudoers.d ===" cat /etc/sudoers.d/* 2>/dev/null || echo "N/A" echo echo "=== sudo version ===" sudo --version 2>/dev/null | head -1 || echo "N/A" } > "$OUTPUT_DIR/sudo.txt" ``` Root scheduled tasks are also recorded: ```bash echo "=== crontab root ===" crontab -u root -l 2>/dev/null || echo "no crontab for root" ``` ### Technical Analysis The script does not establish a restrictive `umask` before creating the report directory and files. Under a common `umask` of `022`, `mkdir` generally creates the directory with mode `0755`, while shell redirections generally create files with mode `0644`. Because the script is intended to run with `sudo`, it can read information unavailable to ordinary users and then copy that information into ...[truncated 2637 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (40)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The stated purpose is compliance auditing, but the behavior described by the finding indicates broad system data collection, including sensitive security configuration and account-related artifacts, without clearly disclosing that scope. This mismatch is dangerous because users may authorize the skill expecting a narrow audit, while it actually performs extensive host reconnaissance and exports sensitive baseline data.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 240)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 5.2.1 | 无空密码用户 | 无 | `awk -F: '($2 == "")' /etc/shadow` | auto | 命令一致 |
| 5.2.2 | root 唯一 UID 0 | 仅 root | `awk -F: '($3 == 0)' /etc/passwd` | auto | 应只有 root |
| 5.2.3 | root 组 GID 0 | 仅 root | `awk -F: '($1 == "root")' /etc/group` | auto | 命令一致 |
| 5.2.4 | .forward 文件 | 无 | `find /home -name .forward` | auto | 不应存在 |

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 250)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 5.3.1 | sudo 安装 | 已安装 | `rpm -q sudo` | auto | 命令一致 |
| 5.3.2 | sudo 配置 | 安全 | `visudo -c -f /etc/sudoers` | auto | 命令一致 |
| 5.3.3 | sudo 日志 | 已配置 | `grep logfile /etc/sudoers` | auto | 应配置日志 |
| 5.3.4 | sudo 超时 | ≤ 15 min | `grep timestamp_timeout /etc/sudoers` | auto | 值应 ≤ 15 |

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 251)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 5.3.1 | sudo 安装 | 已安装 | `rpm -q sudo` | auto | 命令一致 |
| 5.3.2 | sudo 配置 | 安全 | `visudo -c -f /etc/sudoers` | auto | 命令一致 |
| 5.3.3 | sudo 日志 | 已配置 | `grep logfile /etc/sudoers` | auto | 应配置日志 |
| 5.3.4 | sudo 超时 | ≤ 15 min | `grep timestamp_timeout /etc/sudoers` | auto | 值应 ≤ 15 |

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 252)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 5.3.1 | sudo 安装 | 已安装 | `rpm -q sudo` | auto | 命令一致 |
| 5.3.2 | sudo 配置 | 安全 | `visudo -c -f /etc/sudoers` | auto | 命令一致 |
| 5.3.3 | sudo 日志 | 已配置 | `grep logfile /etc/sudoers` | auto | 应配置日志 |
| 5.3.4 | sudo 超时 | ≤ 15 min | `grep timestamp_timeout /etc/sudoers` | auto | 值应 ≤ 15 |

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 253)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 5.3.1 | sudo 安装 | 已安装 | `rpm -q sudo` | auto | 命令一致 |
| 5.3.2 | sudo 配置 | 安全 | `visudo -c -f /etc/sudoers` | auto | 命令一致 |
| 5.3.3 | sudo 日志 | 已配置 | `grep logfile /etc/sudoers` | auto | 应配置日志 |
| 5.3.4 | sudo 超时 | ≤ 15 min | `grep timestamp_timeout /etc/sudoers` | auto | 值应 ≤ 15 |

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The script reads /etc/shadow and writes derived data to an output file, including the first three characters of password hash fields for up to 20 users. Even partial hash disclosure and identification of accounts with active password entries can aid offline analysis, account enumeration, or correlation attacks, especially if the baseline artifacts are moved off-host or handled insecurely.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 154)May include surrounding context.

sh
cat /etc/security/faillock.conf 2>/dev/null || echo "N/A"
    echo
    echo "=== shadow (users only) ==="
    awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A"
    echo
    echo "=== passwd (UID 0) ==="
    awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 241)May include surrounding context.

md
awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A"
    echo
    echo "=== passwd (UID 0) ==="
    awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null
    echo
    echo "=== 空密码用户检查 ==="
    awk -F: '($2 == ""){print $1}' /etc/shadow 2>/dev/null || echo "none"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 157)May include surrounding context.

sh
awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A"
    echo
    echo "=== passwd (UID 0) ==="
    awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null
    echo
    echo "=== 空密码用户检查 ==="
    awk -F: '($2 == ""){print $1}' /etc/shadow 2>/dev/null || echo "none"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 213)May include surrounding context.

sh
awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A"
    echo
    echo "=== passwd (UID 0) ==="
    awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null
    echo
    echo "=== 空密码用户检查 ==="
    awk -F: '($2 == ""){print $1}' /etc/shadow 2>/dev/null || echo "none"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 214)May include surrounding context.

sh
awk -F: '($2 != "*" && $2 != "!!"){print $1": "substr($2,1,3)"..."}' /etc/shadow 2>/dev/null | head -20 || echo "N/A"
    echo
    echo "=== passwd (UID 0) ==="
    awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null
    echo
    echo "=== 空密码用户检查 ==="
    awk -F: '($2 == ""){print $1}' /etc/shadow 2>/dev/null || echo "none"

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Querying /etc/shadow to identify accounts with empty password fields is a legitimate audit action, but the result is sensitive account-security information that is written to disk. In context, the danger is not malicious credential theft but creation of a plaintext artifact that reveals weak account states to anyone who can access the report.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 160)May include surrounding context.

sh
awk -F: '($3 == 0){print $1}' /etc/passwd 2>/dev/null
    echo
    echo "=== 空密码用户检查 ==="
    awk -F: '($2 == ""){print $1}' /etc/shadow 2>/dev/null || echo "none"
} > "$OUTPUT_DIR/password-policy.txt"

# ---- sudo ----

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill defines filesystem-affecting behavior such as reading references and writing reports, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations weakens least-privilege controls and can allow broader-than-expected file access when the skill is invoked.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases are broad requests such as auditing or checking a machine's security baseline, without clear constraints about target authorization, environment, privilege level, or expected data handling. In practice, this can cause the skill to activate in situations where the user did not intend a privileged host audit or sensitive system inventory collection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

该 markdown 文件从标题到维护说明均以中文撰写,没有提供用户可选择的语言/locale 选项,也没有说明该技能仅面向特定中文使用场景。根据规则,未经用户选择而固定单一语言属于自然语言层面的 locale policy 风险。

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 106)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 2.1.1 | cron daemon | 已启用 | `systemctl is-enabled crond` | auto | 服务名一致 |
| 2.1.2 | crontab 权限 | 600/700 | `stat /etc/crontab` | auto | 命令一致 |
| 2.1.3 | cron 小时目录权限 | 700 | `stat /etc/cron.hourly` | auto | 命令一致 |
| 2.1.4 | cron 每日目录权限 | 700 | `stat /etc/cron.daily` | auto | 命令一致 |

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 171)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 2.1.1 | cron daemon | 已启用 | `systemctl is-enabled crond` | auto | 服务名一致 |
| 2.1.2 | crontab 权限 | 600/700 | `stat /etc/crontab` | auto | 命令一致 |
| 2.1.3 | cron 小时目录权限 | 700 | `stat /etc/cron.hourly` | auto | 命令一致 |
| 2.1.4 | cron 每日目录权限 | 700 | `stat /etc/cron.daily` | auto | 命令一致 |

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 191)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 2.1.1 | cron daemon | 已启用 | `systemctl is-enabled crond` | auto | 服务名一致 |
| 2.1.2 | crontab 权限 | 600/700 | `stat /etc/crontab` | auto | 命令一致 |
| 2.1.3 | cron 小时目录权限 | 700 | `stat /etc/cron.hourly` | auto | 命令一致 |
| 2.1.4 | cron 每日目录权限 | 700 | `stat /etc/cron.daily` | auto | 命令一致 |

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 211)May include surrounding context.

md
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 2.1.1 | cron daemon | 已启用 | `systemctl is-enabled crond` | auto | 服务名一致 |
| 2.1.2 | crontab 权限 | 600/700 | `stat /etc/crontab` | auto | 命令一致 |
| 2.1.3 | cron 小时目录权限 | 700 | `stat /etc/cron.hourly` | auto | 命令一致 |
| 2.1.4 | cron 每日目录权限 | 700 | `stat /etc/cron.daily` | auto | 命令一致 |

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · scripts/collect-baseline.sh (reported line 107)May include surrounding context.

sh
| CIS 编号 | 标题 | RHEL 预期值 | OpenEuler 等效检查 | 状态 | 备注 |
|----------|------|-------------|-------------------|------|------|
| 2.1.1 | cron daemon | 已启用 | `systemctl is-enabled crond` | auto | 服务名一致 |
| 2.1.2 | crontab 权限 | 600/700 | `stat /etc/crontab` | auto | 命令一致 |
| 2.1.3 | cron 小时目录权限 | 700 | `stat /etc/cron.hourly` | auto | 命令一致 |
| 2.1.4 | cron 每日目录权限 | 700 | `stat /etc/cron.daily` | auto | 命令一致 |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 246)May include surrounding context.

md
#!/bin/bash
# collect-baseline.sh — OpenEuler 系统基线收集脚本
# 用法: sudo ./collect-baseline.sh [输出目录]
# 收集目标系统的安全相关配置,生成带时间戳的基线快照
# 供 diff-analysis.py 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 250)May include surrounding context.

md
#!/bin/bash
# collect-baseline.sh — OpenEuler 系统基线收集脚本
# 用法: sudo ./collect-baseline.sh [输出目录]
# 收集目标系统的安全相关配置,生成带时间戳的基线快照
# 供 diff-analysis.py 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 251)May include surrounding context.

md
#!/bin/bash
# collect-baseline.sh — OpenEuler 系统基线收集脚本
# 用法: sudo ./collect-baseline.sh [输出目录]
# 收集目标系统的安全相关配置,生成带时间戳的基线快照
# 供 diff-analysis.py 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 252)May include surrounding context.

md
#!/bin/bash
# collect-baseline.sh — OpenEuler 系统基线收集脚本
# 用法: sudo ./collect-baseline.sh [输出目录]
# 收集目标系统的安全相关配置,生成带时间戳的基线快照
# 供 diff-analysis.py 使用

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cis-rhel-benchmark-mapping.md (reported line 253)May include surrounding context.

md
#!/bin/bash
# collect-baseline.sh — OpenEuler 系统基线收集脚本
# 用法: sudo ./collect-baseline.sh [输出目录]
# 收集目标系统的安全相关配置,生成带时间戳的基线快照
# 供 diff-analysis.py 使用

Static analysis

No suspicious patterns detected.