Back to skill

Security audit

元安全 yotta-agent-hardening

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised local security checks, with disclosed installation and logging behavior and some limitations in its coverage claims.

Use a reviewed, fixed package version and select the intended installation directory; updates overwrite this skill's existing files. Scan only authorized directories and check symbolic links because traversal can reach outside the chosen folder. Keep isolation selected for sensitive-data checks despite the unconditional report wording. Every scan saves local audit metadata; review generated guardrails before adopting them. Manual inspection addressed the scanner's material coverage gaps, but future npm releases are outside this review.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (47)

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · README.md (reported line 123)May include surrounding context.

  • Authorization: directory and configuration inspection assumes the user owns or is authorized for them; sensitive data (keys / credentials) is reported by location and risk level only — contents are never echoed.
  • Legal redlines: this skill is for defense / hardening / education on your own environments only; it produces no executable injection strings, no evasion, no phishing and no social-engineering steps; users are responsible for applicable law (e.g. China Cybersecurity Law, Criminal Law Articles 285/286).

Installation

Pick any of the four methods below; the order is the recommended priority. Skill files always come from npm (GitHub can be slow without a proxy; npm supports mirrors).

Method 1: npm one-liner (recommended)

text
# Optional China mirror: npm config set registry https://registry.npmmirror.com
npx -y @yottameta/yotta-agent-hardening --agent <agent-name>      # install to the agent's default user-level skills dir
npx -y @yottameta/yotta-age

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 · README.zh-CN.md (reported line 45)May include surrounding context.

md
### 域 3:数据隔离

审视<b>数据怎么进、怎么出</b>:脚本读取路径(home / .ssh / .aws / .env / cookie / token 文件)、输出面(写日志 / 上传 / 网络请求 / 消息)、配置文件里的凭据字面量。检测敏感读取、跨上下文外传链、输出脱敏缺口、硬编码凭据。

## 防御守则(强制规则,非建议)

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 · SKILL.md (reported line 42)May include surrounding context.

md
### 域 3:数据隔离

审视**数据怎么进、怎么出**:脚本读取路径(home / .ssh / .aws / .env / cookie / token 文件)、
输出面(写日志 / 上传 / 网络请求 / 消息)、配置文件里的凭据字面量。检测敏感读取、跨上下文外传链、
输出脱敏缺口、硬编码凭据。

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/detection-items.md (reported line 52)May include surrounding context.

md
| 检测器 | 规则号 | 严重级 | 检测内容 |
|---|---|---|---|
| CredentialTheft | CRE-001 ~ CRE-007 | critical ~ medium | macOS 系统凭据存储访问、SSH 私钥文件、AWS 凭据文件、Windows 凭据解密接口、口令库 / 凭据文件、Cookie / 会话相关操作 |
| Exfiltration | EXF-001 ~ EXF-005 | high | 打包压缩上传、归档上传、读取 .env 后外传、读取 SSH 私钥后外传、读取凭据后外传 |
| SensitiveRead | HIS-001 / HIS-001E | high / medium | 脚本读取高敏路径(SSH 私钥 / 云凭据 / 口令库等);读取 .env / cookie / token 等敏感文件(引擎级,**默认开启、无关闭开关**) |
| CrossContextExfiltration | HIS-002 | high | 同一文件「敏感读取 + 网络原语」共现(跨上下文外传风险,需确认数据不随请求外发) |
| OutputSanitizationGap | HIS-003 | medium | 把密钥 / 令牌值打印或写入日志(输出脱敏缺口,建议先脱敏再输出) |

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/detection-items.md (reported line 53)May include surrounding context.

md
|---|---|---|---|
| CredentialTheft | CRE-001 ~ CRE-007 | critical ~ medium | macOS 系统凭据存储访问、SSH 私钥文件、AWS 凭据文件、Windows 凭据解密接口、口令库 / 凭据文件、Cookie / 会话相关操作 |
| Exfiltration | EXF-001 ~ EXF-005 | high | 打包压缩上传、归档上传、读取 .env 后外传、读取 SSH 私钥后外传、读取凭据后外传 |
| SensitiveRead | HIS-001 / HIS-001E | high / medium | 脚本读取高敏路径(SSH 私钥 / 云凭据 / 口令库等);读取 .env / cookie / token 等敏感文件(引擎级,**默认开启、无关闭开关**) |
| CrossContextExfiltration | HIS-002 | high | 同一文件「敏感读取 + 网络原语」共现(跨上下文外传风险,需确认数据不随请求外发) |
| OutputSanitizationGap | HIS-003 | medium | 把密钥 / 令牌值打印或写入日志(输出脱敏缺口,建议先脱敏再输出) |
| HardcodedSecret | HIS-004 | medium | 配置文件疑似硬编码凭据值(密钥 / 令牌 / 口令字面量,建议改用环境变量或凭据管理器) |

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/hardening_rules.py (reported line 62)May include surrounding context.

python
# 仅在脚本代码上运行(破坏性 / 自动确认 / 敏感输出)
    "HTO-001": SCOPE_SCRIPTS, "HTO-001L": SCOPE_SCRIPTS, "HTO-002": SCOPE_SCRIPTS,
    "HIS-003": SCOPE_SCRIPTS,
    # 仅在配置面文件上运行(MCP / agent 配置 / .env 类)
    "HTO-005": SCOPE_CONFIGS, "HTO-006": SCOPE_CONFIGS, "HTO-007": SCOPE_CONFIGS,
    "HIS-004": SCOPE_CONFIGS,
    # 文档 + 配置(权限 / 网络声明)

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/hardening_rules.py (reported line 167)May include surrounding context.

python
"Python 归档后上传", 85),
    Rule("EXF-003", "Exfiltration", "high",
         r"(?i)(?:\.env[^\n;]{0,80}(?:\bcurl\b|\bwget\b|requests\.post|urllib)|(?:\bcurl\b|\bwget\b|requests\.post|urllib)[^\n;]{0,80}\.env)",
         "读取 .env 后外传", 88),
    Rule("EXF-004", "Exfiltration", "high",
         r"(?i)(?:(?:id_rsa|id_ed25519|\.ssh)[^\n;]{0,80}(?:\bcurl\b|\bwget\b|requests\.post|urllib|ftp)|(?:\bcurl\b|\bwget\b|requests\.post|urllib|ftp)[^\n;]{0,80}(?:id_rsa|id_ed25519|\.ssh))",
         "读取 SSH 私钥后外传", 92),

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/hardening_rules.py (reported line 324)May include surrounding context.

python
"数据外传指令(中文)", 80),
    Rule("PIJ-013", "PromptInjection", "high",
         r"(?i)(?:read|open|load)\s+[^\n]{0,60}\.env\b[^\n]{0,80}(?:send|upload|post|exfil|传|发)",
         "读取 .env 后外传", 88),
    # ── 分隔符逃逸 / 伪系统标签 ──────────────────────────────────────────
    Rule("PIJ-014", "PromptInjection", "medium",
         r"(?i)(?:<|\[|\{)?\s*(?:system|sysadmin)\s*(?:message|prompt|instruction|role)?\s*(?:>|\]|\})",

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/hardening_rules.py (reported line 440)May include surrounding context.

python
HIGH_SENS_READ_RE = re.compile(
    r"(?i)(?:\.ssh[\\/]id_|\.aws[\\/]credentials|\.netrc|\.pgpass|id_rsa|id_ed25519|id_dsa"
    r"|keych[ai]n|DPAP[I1]|win32crypt|credential_store|password_store)")
# 中敏读取:.env / cookie / token / 本地凭据文件
MED_SENS_READ_RE = re.compile(
    r"(?i)(?:\.env\b|cookies?\.(?:json|txt)|tokens?\.(?:json|txt)|session\.(?:json|txt)"
    r"|\.npmrc|\.gitconfig|credentials\.json|secrets?\.json)")

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The supplied chunk's primary function is installation, not the declared static security assessment. Its normal execution writes files and can delete existing artifacts under installation destinations; these installation and cleanup capabilities are not disclosed in the description. Although an installer can support a scanning skill, this chunk implements a separate deployment operation rather than an internal detail of read-only analysis. The code includes target and symlink checks, and no network transfer or exfiltration is evident. This finding is limited to the supplied installer and does not establish whether other files implement the advertised scanner.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 180)May include surrounding context.

python
r"(?i)osascript[^\n;]{0,120}(?:password|passphrase)",
         "macOS 弹窗套取密码", 90),
    Rule("CRE-002", "CredentialTheft", "critical",
         r"(?i)security\s+find-generic-password|keychain",
         "访问 macOS keychain 凭据", 85),
    Rule("CRE-003", "CredentialTheft", "high",
         r"(?i)(?:id_rsa|id_ed25519|id_dsa)\.?(?:pub)?\b",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 181)May include surrounding context.

python
"macOS 弹窗套取密码", 90),
    Rule("CRE-002", "CredentialTheft", "critical",
         r"(?i)security\s+find-generic-password|keychain",
         "访问 macOS keychain 凭据", 85),
    Rule("CRE-003", "CredentialTheft", "high",
         r"(?i)(?:id_rsa|id_ed25519|id_dsa)\.?(?:pub)?\b",
         "读取 SSH 私钥文件", 80),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 233)May include surrounding context.

python
"chmod 设置 setuid/setgid/sticky 权限位", 85),
    Rule("PRI-002", "PrivilegeEscalation", "high",
         r"(?i)\bchmod\s+777\b",
         "chmod 777 全权限", 70),
    Rule("PRI-003", "PrivilegeEscalation", "high",
         r"(?i)\bsetuid\s*\(|setgid\s*\(",
         "调用 setuid/setgid", 80),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 402)May include surrounding context.

python
r"|/home(?:\s|/|$)|/root(?:\s|/|$)|/boot(?:\s|/|$)|/dev(?:\s|/|$)|~|C:)"
         r"|shutil\.rmtree\s*\(\s*['\"](?:/(?=['\"])|/etc|/usr|/var|/home|/root|/boot|/dev|C:|~)"
         r"|Remove-Item\s+-Recurse[^\n]{0,40}C:\\)",
         "破坏性删除指向系统或根路径(rm -rf /、递归删除系统目录等)", 90),
    Rule("HTO-001L", "RecursiveDelete", "low",
         r"(?i)(?:rm\s+-rf|shutil\.rmtree|os\.removedirs|Remove-Item\s+-Recurse|os\.remove\s*\(|os\.unlink\s*\()",
         "脚本含删除/递归删除原语(需确认删除目标与必要性)", 60),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 402)May include surrounding context.

python
r"|/home(?:\s|/|$)|/root(?:\s|/|$)|/boot(?:\s|/|$)|/dev(?:\s|/|$)|~|C:)"
         r"|shutil\.rmtree\s*\(\s*['\"](?:/(?=['\"])|/etc|/usr|/var|/home|/root|/boot|/dev|C:|~)"
         r"|Remove-Item\s+-Recurse[^\n]{0,40}C:\\)",
         "破坏性删除指向系统或根路径(rm -rf /、递归删除系统目录等)", 90),
    Rule("HTO-001L", "RecursiveDelete", "low",
         r"(?i)(?:rm\s+-rf|shutil\.rmtree|os\.removedirs|Remove-Item\s+-Recurse|os\.remove\s*\(|os\.unlink\s*\()",
         "脚本含删除/递归删除原语(需确认删除目标与必要性)", 60),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 402)May include surrounding context.

python
r"|/home(?:\s|/|$)|/root(?:\s|/|$)|/boot(?:\s|/|$)|/dev(?:\s|/|$)|~|C:)"
         r"|shutil\.rmtree\s*\(\s*['\"](?:/(?=['\"])|/etc|/usr|/var|/home|/root|/boot|/dev|C:|~)"
         r"|Remove-Item\s+-Recurse[^\n]{0,40}C:\\)",
         "破坏性删除指向系统或根路径(rm -rf /、递归删除系统目录等)", 90),
    Rule("HTO-001L", "RecursiveDelete", "low",
         r"(?i)(?:rm\s+-rf|shutil\.rmtree|os\.removedirs|Remove-Item\s+-Recurse|os\.remove\s*\(|os\.unlink\s*\()",
         "脚本含删除/递归删除原语(需确认删除目标与必要性)", 60),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 402)May include surrounding context.

python
r"|/home(?:\s|/|$)|/root(?:\s|/|$)|/boot(?:\s|/|$)|/dev(?:\s|/|$)|~|C:)"
         r"|shutil\.rmtree\s*\(\s*['\"](?:/(?=['\"])|/etc|/usr|/var|/home|/root|/boot|/dev|C:|~)"
         r"|Remove-Item\s+-Recurse[^\n]{0,40}C:\\)",
         "破坏性删除指向系统或根路径(rm -rf /、递归删除系统目录等)", 90),
    Rule("HTO-001L", "RecursiveDelete", "low",
         r"(?i)(?:rm\s+-rf|shutil\.rmtree|os\.removedirs|Remove-Item\s+-Recurse|os\.remove\s*\(|os\.unlink\s*\()",
         "脚本含删除/递归删除原语(需确认删除目标与必要性)", 60),

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 438)May include surrounding context.

python
# ── 引擎级正则(敏感读取 / 网络原语 / 敏感输出)──────────────────────────
# 高敏读取:SSH 私钥 / 云凭据 / 口令库
HIGH_SENS_READ_RE = re.compile(
    r"(?i)(?:\.ssh[\\/]id_|\.aws[\\/]credentials|\.netrc|\.pgpass|id_rsa|id_ed25519|id_dsa"
    r"|keych[ai]n|DPAP[I1]|win32crypt|credential_store|password_store)")
# 中敏读取:.env / cookie / token / 本地凭据文件
MED_SENS_READ_RE = re.compile(

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/hardening_rules.py (reported line 443)May include surrounding context.

python
# 中敏读取:.env / cookie / token / 本地凭据文件
MED_SENS_READ_RE = re.compile(
    r"(?i)(?:\.env\b|cookies?\.(?:json|txt)|tokens?\.(?:json|txt)|session\.(?:json|txt)"
    r"|\.npmrc|\.gitconfig|credentials\.json|secrets?\.json)")
# 网络原语(跨上下文外传共现检测用)
NET_PRIMITIVE_RE = re.compile(
    r"(?i)\b(?:urllib|requests|httpx|http\.client|socket|aiohttp|curl|wget|"

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · scripts/yotta_agent_hardening.py (reported line 98)May include surrounding context.

python
".pl", ".php", ".lua",
}
DOTFILE_NAMES = {
    ".env", ".env.example", ".netrc", ".pgpass", ".bashrc", ".zshrc",
    ".profile", ".bash_profile", ".npmrc", ".gitconfig",
}
SCRIPT_EXTS = {

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/yotta_agent_hardening.py (reported line 98)May include surrounding context.

python
".pl", ".php", ".lua",
}
DOTFILE_NAMES = {
    ".env", ".env.example", ".netrc", ".pgpass", ".bashrc", ".zshrc",
    ".profile", ".bash_profile", ".npmrc", ".gitconfig",
}
SCRIPT_EXTS = {

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/yotta_agent_hardening.py (reported line 99)May include surrounding context.

python
}
DOTFILE_NAMES = {
    ".env", ".env.example", ".netrc", ".pgpass", ".bashrc", ".zshrc",
    ".profile", ".bash_profile", ".npmrc", ".gitconfig",
}
SCRIPT_EXTS = {
    ".py", ".js", ".ts", ".jsx", ".tsx", ".mjs", ".cjs", ".sh", ".bash",

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/yotta_agent_hardening.py (reported line 452)May include surrounding context.

python
findings.append(Finding(
                        "HIS-001E", "SensitiveRead", "medium", "isolation", rel,
                        lineno,
                        "脚本读取 .env / cookie / token 等敏感文件,请确认读取必要性与不落盘不外发", 60))
                if high_line and med_line:
                    break
            sens_ctx[rel] = {"high": high_line, "med": med_line, "net": False}

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 133)May include surrounding context.

text
# Optional China mirror: npm config set registry https://registry.npmmirror.com
npx -y @yottameta/yotta-agent-hardening --agent <agent-name>      # install to the agent's default user-level skills dir
npx -y @yottameta/yotta-agent-hardening --dir <your-skills-dir>   # point to the skills dir itself (e.g. ~/.codex/skills)

MCP server referenced without pinned version: 'npx -y @yottameta/yotta-agent-hardening'.

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

Although this is an installer rather than an MCP server, the command executes an unpinned npm package with automatic acceptance. A compromised future release could execute code with the user's permissions and modify agent skills, making the supply-chain exposure particularly relevant.

Content

No source excerpt is available for this finding.