@kenhkl/agent-moss 0.11.4 → 0.11.5
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/dist/cli.js +7 -2
- package/dist/cli.js.map +1 -1
- package/dist/engine/coordinator.js +7 -2
- package/dist/engine/coordinator.js.map +1 -1
- package/dist/server.js +7 -2
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2303,7 +2303,7 @@ function runHeuristicCheck(input) {
|
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
2305
|
}
|
|
2306
|
-
const injectionText = `${input.aNext.actionType} ${input.aNext.actionDetail} ${input.reason || ""} ${input.promptSession || ""}`.toLowerCase();
|
|
2306
|
+
const injectionText = isSearchActionType(input.aNext.actionType) ? `${input.aNext.actionType} ${input.reason || ""} ${input.promptSession || ""}`.toLowerCase() : `${input.aNext.actionType} ${input.aNext.actionDetail} ${input.reason || ""} ${input.promptSession || ""}`.toLowerCase();
|
|
2307
2307
|
const injectionHits = checkInjectionKeywords(injectionText, agentExt?.extra_injection_keywords);
|
|
2308
2308
|
if (injectionHits.length > 0) {
|
|
2309
2309
|
const topHit = injectionHits.reduce((a, b) => severityRank(a.riskLevel) >= severityRank(b.riskLevel) ? a : b);
|
|
@@ -2430,6 +2430,10 @@ function severityRank(s) {
|
|
|
2430
2430
|
const ranks = { low: 1, medium: 2, high: 3, critical: 4 };
|
|
2431
2431
|
return ranks[s] || 0;
|
|
2432
2432
|
}
|
|
2433
|
+
function isSearchActionType(actionType) {
|
|
2434
|
+
const at = actionType.toLowerCase();
|
|
2435
|
+
return SEARCH_ACTION_PREFIXES.some((p) => at.startsWith(p)) || ["websearch", "web_search", "search", "query"].includes(at);
|
|
2436
|
+
}
|
|
2433
2437
|
function checkSensitivePath(command, cwd, agentExt) {
|
|
2434
2438
|
const expandedCwd = cwd.replace(/^~/, process.env.HOME || "/home/user");
|
|
2435
2439
|
const isWriteOpFlag = isWriteOperation("", command);
|
|
@@ -2697,7 +2701,7 @@ function checkLateralMovement(actionDetail) {
|
|
|
2697
2701
|
}
|
|
2698
2702
|
return null;
|
|
2699
2703
|
}
|
|
2700
|
-
var INJECTION_KEYWORDS, DANGEROUS_PATTERNS, SENSITIVE_EXCLUDED_PREFIXES;
|
|
2704
|
+
var INJECTION_KEYWORDS, DANGEROUS_PATTERNS, SENSITIVE_EXCLUDED_PREFIXES, SEARCH_ACTION_PREFIXES;
|
|
2701
2705
|
var init_heuristic = __esm({
|
|
2702
2706
|
"src/engine/heuristic.ts"() {
|
|
2703
2707
|
"use strict";
|
|
@@ -2863,6 +2867,7 @@ var init_heuristic = __esm({
|
|
|
2863
2867
|
{ pattern: /\b(useradd|luseradd|groupadd|usermod|lusermod|groupmod|lgroupmod)\b[^&|;]*?\s-p\b/i, severity: "high", description: "\u68C0\u6D4B\u5230\u901A\u8FC7 -p \u53C2\u6570\u8BBE\u7F6E\u6216\u4FEE\u6539\u5BC6\u7801 (useradd/usermod/groupmod)", riskType: "script_execution" }
|
|
2864
2868
|
];
|
|
2865
2869
|
SENSITIVE_EXCLUDED_PREFIXES = ["memory-", "skill-", "skill-manager-", "mailbox-", "app-"];
|
|
2870
|
+
SEARCH_ACTION_PREFIXES = ["search-", "web-", "browser-", "query-", "websearch", "web_search"];
|
|
2866
2871
|
}
|
|
2867
2872
|
});
|
|
2868
2873
|
|