@kenhkl/agent-moss 0.16.14 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -439,10 +439,10 @@
439
439
  "reason": "检测到定时任务执行世界可写目录(/tmp、/var/tmp、/dev/shm)下的脚本(cron 持久化后门:任何用户可替换该脚本,重启/定时以任务属主身份执行)"
440
440
  },
441
441
  {
442
- "pattern": "\\b(?:while\\s+(?:true|:|1)\\b|for\\s*\\(\\s*\\(?\\s*(?:;|;;)\\s*\\)?\\s*)",
442
+ "pattern": "\\b(?:while\\s+(?:true\\b|1\\b|:(?=\\s|;|$|\\)))|until\\s+false\\b|for\\s*\\(\\s*\\(?\\s*(?:;|;;)\\s*\\)?\\s*)",
443
443
  "risk_level": "high",
444
444
  "risk_type": "resource_exhaustion",
445
- "reason": "检测到无限循环(while true/for(;;)/while :),可能用于拒绝服务攻击或资源滥用"
445
+ "reason": "检测到无限循环(while true / while 1 / while : / until false / for(;;)),可能用于拒绝服务攻击或资源滥用"
446
446
  },
447
447
  {
448
448
  "pattern": "\\byes\\s*(?:>\\s*/dev/null\\s*&|>/dev/null\\s*&\\s*$)",
@@ -2053,6 +2053,55 @@
2053
2053
  "deny_mode": "deny_both",
2054
2054
  "scope": "credential"
2055
2055
  },
2056
+ {
2057
+ "path": ".config/agentmoss/auth_token",
2058
+ "risk_level": "critical",
2059
+ "desc": "AgentMoss 访问 token(拿到即可冒充 agent 调用分析接口、读取其历史)",
2060
+ "deny_mode": "deny_both",
2061
+ "scope": "home"
2062
+ },
2063
+ {
2064
+ "path": ".agentmoss/stateful_chains",
2065
+ "risk_level": "critical",
2066
+ "desc": "AgentMoss 组合链状态库(各 agent 的动作历史与反例路径)",
2067
+ "deny_mode": "deny_both",
2068
+ "scope": "home"
2069
+ },
2070
+ {
2071
+ "path": "agent_moss_policy_cache",
2072
+ "risk_level": "medium",
2073
+ "desc": "AgentMoss policy 缓存(含会话 id 与策略文档)",
2074
+ "deny_mode": "deny_read",
2075
+ "scope": "root"
2076
+ },
2077
+ {
2078
+ "path": "agent_moss/rules",
2079
+ "risk_level": "medium",
2080
+ "desc": "AgentMoss 内置检测规则(读=暴露检测逻辑,可据此构造绕过)",
2081
+ "deny_mode": "deny_read",
2082
+ "scope": "root"
2083
+ },
2084
+ {
2085
+ "path": "agent_moss/skills",
2086
+ "risk_level": "medium",
2087
+ "desc": "AgentMoss 内置 Skill(L3 语义检测口径,读=暴露判定标准)",
2088
+ "deny_mode": "deny_read",
2089
+ "scope": "root"
2090
+ },
2091
+ {
2092
+ "path": "agent_moss/agents/",
2093
+ "risk_level": "medium",
2094
+ "desc": "三方 agent 定制规则目录(读=暴露针对该 agent 的检测规则)",
2095
+ "deny_mode": "deny_read",
2096
+ "scope": "root"
2097
+ },
2098
+ {
2099
+ "path": "agent_moss/scenarios/",
2100
+ "risk_level": "medium",
2101
+ "desc": "场景定制规则目录(读=暴露客户沙箱的目录白名单等部署约束)",
2102
+ "deny_mode": "deny_read",
2103
+ "scope": "root"
2104
+ },
2056
2105
  {
2057
2106
  "path": ".config/agentmoss/config.json",
2058
2107
  "risk_level": "critical",
@@ -173,7 +173,8 @@
173
173
  "(?:cat|head|tail|less|more|grep)\\s+[^;&|\\n]*known_hosts",
174
174
  "\\bpython3?\\s+-c\\s+['\\\"][\\s\\S]{0,200}?(?:base64\\.b64encode|open\\s*\\(|Path\\(|io\\.open\\s*\\(|read_text\\s*\\(|read\\s*\\()[\\s\\S]{0,200}?(?:/etc/shadow|/etc/passwd|id_rsa|credentials|\\.ssh)",
175
175
  "(?:grep|find|cat)\\s+[^;&|\\n]*\\b(?:password|secret|passwd|shadow|credential|api[_-]?key)\\b[^;&|\\n]*(?:/etc/shadow|/etc/passwd|id_rsa|credentials|\\.ssh)",
176
- "(?:cp|mv|dd|curl)\\s+[^;&|\\n]*(?:/etc/shadow|/etc/passwd|id_rsa|credentials|\\.ssh)"
176
+ "(?:cp|mv|dd|curl)\\s+[^;&|\\n]*(?:/etc/shadow|/etc/passwd|id_rsa|credentials|\\.ssh)",
177
+ "(?:cat|head|tail|less|more|sed|awk|strings|base64|dd|cp|mv|grep|xxd|od)\\s+[^;&|\\n]*(?:\\.config/agentmoss/auth_token|\\.agentmoss/stateful_chains|agent_moss_policy_cache|agent_moss/rules|agent_moss/skills|agent_moss/agents/|agent_moss/scenarios/)"
177
178
  ],
178
179
  "PERSIST": [
179
180
  "(?:echo|printf|cat)\\b[^;\\n]*\\|[^;\\n]*(?:crontab|at\\b)\\s*-",