ai-helper-agent 1.3.3 → 1.3.4
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.
- package/package.json +1 -1
- package/src/security.js +3 -3
package/package.json
CHANGED
package/src/security.js
CHANGED
|
@@ -94,9 +94,9 @@ const BLACKLIST_PATTERNS = [
|
|
|
94
94
|
// 修改根目录权限
|
|
95
95
|
/^\s*chmod\s+(-R\s+)?(0?777|a\+rwx)\s+\//,
|
|
96
96
|
/^\s*chown\s+-R\s+\S+\s+\//,
|
|
97
|
-
// Shell
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
// Shell 命令替换注入 — 允许 echo/printf 等纯输出命令中使用
|
|
98
|
+
/^\s*(?!(echo|printf|cat|head|tail|wc|ls|pwd|date|whoami|hostname|uname|id|env|printenv|which|type)\s).*`[^`]*`/,
|
|
99
|
+
/^\s*(?!(echo|printf|cat|head|tail|wc|ls|pwd|date|whoami|hostname|uname|id|env|printenv|which|type)\s).*\$\s*\([^)]*\)/,
|
|
100
100
|
];
|
|
101
101
|
|
|
102
102
|
const SCRIPT_EXTENSIONS = '(sh|bash|zsh|py|js|mjs|rb|pl|php|lua)';
|